1
votes

I am reading an existing PDF file into a new PDF file, and scaling the first page based on the page dimensions. The page gets scaled to 90-95% in order to make room for some footer text. The problem I have is that the resulting scaled page leaves white space at the top of the page, NOT the bottom. Is there a way to control the results so that they start in the top left of the page and not the bottom left?

Here's my code that adds the scaled page: cb.AddTemplate(importedPage, scaleSize, 0, 0, scaleSize, 5, 20);

Object "cb" is a PDFContentByte class, while "scaleSize" is a float set to .9 or .95. The scaling works great, but the positioning is an issue. Thanks!

1
I figured it out: the value of "20" for the final parameter was incorrect. A value of 100 is far more suitable for my purposes, and now I understand far better the coordinate system in PDF/iText. - JDN

1 Answers

0
votes

figured it out: the value of "20" for the final parameter was incorrect. A value of 100 is far more suitable for my purposes, and now I understand far better the coordinate system in PDF/iText. For those interested, the 0, 0 point for a PDF document is the lower left corner.