Append text at the end of a PDF page using Aspose.PDF for .NET

Hi

I’d like to know if there is any way to append a text at the end of a page of an existing PDF document. All the ways I’ve seen inside these forums needs to specify the coordinates (or the rectangle) where the text will be appended but I can’t find how to calculate that coordinates or how to append the text at the end of the page.

Thanks in advance for your help.

Hi Maria,

Thanks for using our products.

Kindly visit the following documentation links for more details and code snippets as per your requirement.

You can use position object for setting the location of text on the page, Position(0,0) means bottom left corner of the page. If you increase the value of xIndent text moves to the right direction and if you increase the value of yIndent text moves to the top direction. So, you can set text position on the page by using values of xIndent and yIndent.

Please feel free to contact support in case you need any further assistance.

Thanks & Regards,

hi Rashid,

thanks for your quick reply. The problem I have is I want to append the text to a page that already has content, in other words, I need to append a text to another existing text inside the PDF, that's why I don't know how to calculate the position of the last existing word in the page.

Thanks in advance, regards

Hi Maria,


Thanks for sharing the details.

In case you need to add text close to another text string inside PDF document, then first you need to search the existing text string using TextFragmentAbsorber and get the position of specific word using TextFragment.Position.YIndent and TextFragment.Position.XIndent properties. Once you have the position/coordinates information, then you can add the new text string relative to that position. Please visit the following links for information on

In case it does not satisfy your requirement or you have any further query, please feel free to contact.