0

I am looking for a solution to a problem I am having, where I need to find the height of the content of the last page of a PDF.

Probably by getting the bottom Y-coordinate of the last element on the page.

I am not looking to just append something at the end of the document, I just want the coordinate where the content of the page ends, so that I can figure out the percentage of remaining space left on the last page.

Stmated
  • 477
  • 5
  • 17
  • iText exists for both Java and C#, you should specify. – Alexandre Lavoie Dec 10 '13 at 13:18
  • Are you interested in text contents only? In that case you might be inspired by [ShowTextMargins.java](http://itextpdf.com/examples/iia.php?id=280), a sample from [iText in Action, Second Edition](http://itextpdf.com/book/) which finds the margins of a page taking only text and bitmap graphic contents into account (i.e. ignoring vector graphics). – mkl Dec 10 '13 at 13:42
  • @AlexandreLavoie I thought "iText" was Java and iTextSharp" was for C#. My bad. This is Java. And, mkl, That looks promising and is better than nothing. But not quite... I have many larger blocks that are not built of text that I need to get the measure of. – Stmated Dec 10 '13 at 14:20
  • @Stmated You might be interested in [this discussion](http://stackoverflow.com/questions/20129775/using-itextpdf-to-trim-a-pages-whitespace/20212172#20212172). – mkl Dec 10 '13 at 17:03

0 Answers0