We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to set absolute positioning of image using C#

I can’t seem to lock down this image to one corner of the pages. Other nodes on the page seem to have a heavy influence on size and location of the image. Is there a was to give a floating image an absolute position on the document? Attached is the console app and test document that is causing the issue.

Thanks,
John

@johnmann04

We are working over your query and will get back to you soon.

@johnmann04

We have investigated this issue and noticed that position of bookmark is incorrect after moving cursor to paragraph and inserting it. So, the barcode position is also incorrect. We have logged this problem in our issue tracking system as WORDSNET-20025. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@johnmann04

In your case, we suggest you please move the cursor to the end of paragraph and insert the bookmark as shown below.

builder.MoveToParagraph(paragraphs.IndexOf(paragraph), -1);
builder.StartBookmark("BM_Page" + pageIndex);
builder.EndBookmark("BM_Page" + pageIndex);

Moreover, we have modified the code to set the shape (barcode) position. Please check the ResizeAndPositionBarcodeTopRight method in the attached project. You can set the shape’s position according to your requirement.
BarcodeTestConsoleApp.zip (2.5 MB)

Thanks for the update, I have downloaded the modified code and tested it locally, using my licence, and I’m seeing one page where there are two bookmarks on the same page which causes two barcodes to show up on that page and no barcode on the next page. Did I miss something?
image.png (240.6 KB)

@johnmann04

Please use the latest version of Aspose.Words for .NET 20.2. We have not found this issue at our end. Moreover, please check the method ResizeAndPositionBarcodeTopRight in the Visual Studio project shared in my previous post. You need to modify this method to set the shape’s position according to your requirement.