Free Support Forum -

Insert text at the end of all pages

Hi guys,

I need to insert a text at the end of the each page of my document. What I’m doing is:

final com.aspose.words.DocumentBuilder builder = new com.aspose.words.DocumentBuilder(document);
for (Section sect : document.getSections()) {
final Paragraph lastPara = sect.getBody().getLastParagraph();
final Paragraph newPara = builder.insertParagraph();
final Run run = new Run(document, WATERMARK_TEXT);
final Font f = run.getFont();
lastPara.getParentNode().insertAfter(newPara, lastPara);

However, the result document is wrong. I’ve attached the input and the output documents.

Best Regards, (17.1 KB)


Please use the codes mentioned in the following article to meet this requirement:
Working with Watermark


I can not log in. I use the same login on this forum but it says that is incorrect.


Please use the following link:

We apologize for your inconvenience.