Now we create a separate page using the addPage PDDocument method and add a block of text to it.
However, I need a way to add a block of text to the last page immediately after the content. Or, if the block does not fit, then create it on a new page.
As I understand it, first we need to find the end of the content. Is there a way to do it?