How to prevent the resizing of pages in PDF?
Posted on StackOverflow on Jun 6, 2014 by Cristi B.
Please add the following line to your code. This line will make sure that the page isn't scaled when printed:
pdfDoc.getCatalog().setViewerPreferences(new PdfViewerPreferences().setPrintScaling(PdfViewerPreferences.PdfViewerPreferencesConstants.NONE));
This is the only parameter you can set to influence the print setting. You can't tell a viewer that it needs to fit the page to the size of the printer page. You can only instruct the viewer that the actual size needs to be taken, by setting the PRINTSCALING
to NONE
.
Click How to prevent the resizing of pages in PDF? if you want to see how to answer this question in iText 5.