You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DocXdocument= DocX.Load(@"C:\Users\benla\Desktop\a1.docx");{varx= document.AddImage(@"D:\Codes\BDS\Src\BDS\Z.TestNewDataConverter\bin\Debug\net6.0-windows\tmp\a.png").CreatePicture();
document.ReplaceTextWithObject("{{@circumferential_distance_img}}", x);varzxc= document.ParagraphsDeepSearch;// Save changes made to this document.//document.Save();}// Release
Nothing changed.
The text was updated successfully, but these errors were encountered:
Hi,
With the Latest version of DocX (v2.5), you can do it this way:
// Load a document.
using( var document = DocX.Load( "ReplaceTextWithObjects.docx" ) )
{
// Create the image from disk and set its size.
var image = document.AddImage( "2018.jpg" );
var picture = image.CreatePicture( 175f, 325f );
// Do the replacement of all the found tags with the specified image and ignore the case when searching for the tags.
document.ReplaceTextWithObject( new ObjectReplaceTextOptions() { SearchValue = "<yEaR_IMAGE>", NewObject = picture, RegExOptions = RegexOptions.IgnoreCase } );
// Save this document to disk.
document.SaveAs( "ReplacedTextWithObjects.docx" );
}
Nothing changed.
The text was updated successfully, but these errors were encountered: