Hello,
I have the same problem, the resulting PDF does not have the same size as
the incoming PDF.
The page size and crop box have the same size A4 but the resulting file has
a smaller page size.
I tried setting the page size and crop box in various ways, following
different suggestions from the forum, ... but could not proceed.
Best regards
Frauke
This is the code base:
PdfReader reader = new PdfReader(pdf); //yout.toByteArray());
Rectangle psize = reader.getPageSize(1);
doc = new Document(psize, 0, 0, 0, 0);
PdfWriter writer = PdfWriter.getInstance(doc, output);
doc.open();
PdfContentByte cb = writer.getDirectContent();
for (int i = 0; i < reader.getNumberOfPages(); i++) {
writer.setCropBoxSize(psize);
PdfImportedPage page = writer.getImportedPage(reader, i +
1);
cb.addTemplate(page, 0, 0);
}
--
View this message in context:
http://www.nabble.com/get-page-size-tp15681779p24373617.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/