Add image to Bookmark
How can I add image to bookmark in .net with xceed?
Hi, We will investigate to add this feature. thank you.
hello do you have any tips to add this feature ?
Is it roughly possible to say when this feature will be added?
The code looks like not so complicated. I find the code for a php library https://github.com/PHPOffice/PHPWord/pull/1516 as I understood, we have to add the file as an attachement to the file and then there is a quite simple code in xml
You can always create an empty paragraph and add the image to it. Then, add the bookmark to this paragraph. Something like :
var doc = DocX.Load("test.docx"); var image = doc.AddImage( "CIMG3709.jpg" ); var picture = image.CreatePicture( 112, 112 ); var p = doc.InsertParagraph(); p.AppendPicture( picture ); p.AppendBookmark( "ImageBookmark" ); doc.SaveAs("test2.docx");
sure but in this case, you add the image to the end of the document the goal is to insert an image to a specified bookmark. I hope it is clear for you.
Hi, You can always modify the paragraph of a specific bookmark : var doc = DocX.Load("test.docx"); var image = doc.AddImage( "CIMG3709.jpg" ); var picture = image.CreatePicture( 112, 112 ); doc.Bookmarks[ 0 ].Paragraph.AppendPicture( picture ); doc.SaveAs("test2.docx");
Is there any one know how to implement this solution in node.js?