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

Free Support Forum - aspose.com

Add label for all pages

Hello,I need to set some element (shape) in top and bottom for all pages without using header, footer and watermarks. Shape is absolutely positioning and storage in other document. How can I get top element for all pages to insert label? I partialy solved it using OpenXml SDK. How your product can help me? Thanks!

Hi,


Thanks for your inquiry.

Please note that MS Word Document is a flow document i.e. it does not contain any information about its layout into pages. So there is no direct way to determine where page starts or ends using Aspose.Words and hence you can’t easily insert elements at the start/end of each page of your document. But, could you please clarify why you’re avoiding the usage of Headers/Footers?

Best Regards,

Hello Awais,

If I insert label in header or footer it can be not visible. If height of header/footer is less than label and if document is not contain header/footer or it height is very small and I change height and layout will be changed. Is there any good solution? I downloaded PageFinder from here but I can not use it because I can not find PageSplitter class. Please see last reply here.

Hi Alex,


Thanks for your inquiry.

You can find the full code in the attachment of this post here: https://forum.aspose.com/t/72285

Hopefully that helps to achieve what you are looking for. Regarding your original issue, based on your description you could use a image in the header or footer. This is because floating objects like most images will always appear regardless of the header footer height. For example, you can make it floating in the center of the page and no matter the header height it will always be visible. You can also add a header or footer to the document if it does not contain one.

The only thing I can think of that might not suit your requirements is that the image in the header or footer will always be behind text. You may want the image to always be in front of text. This is where the code work around will be handy for you.

If we can help with anything else, please feel free to ask.

Thanks,

Hi Adam,

Thanks for you answer. Yes, you are right I want the image to always be in front of text. What version of Aspose.Words I need to use for the example that you point? I use version 10.8, 11.1 and 11.3 and can not find PageSplitter class that is used in PageFinder util.

Alex

Hi Alex,


Thanks for this additional information.

Sorry for the confusion, I meant that the PageSplitter class is work around code for the time being. That code along with PageFinder.cs can be found in the attachment on this post here: https://forum.aspose.com/t/72285

Also it may be useful to read this thread. The thread provides an example of how to use PageFinder to add a image to every page. The thread belongs to a customer who was doing the same thing (adding an image to every page without using header or footer).

If we can help with anything else, please feel free to ask.

Thanks,

The issues you have found earlier (filed as WORDSNET-5904) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)