first of all my congratulations to the authors/developers of iTExt.. great library!!
Using PdfContentByte.addTemplate I've noticed some kind of shift/offset effect in the resulting document and I don't understand why.
Say I have a very simple pdf file with only a rectangle on it, importing it as template on a new document will be printed with an offset in x and y. [see also the 2 attachments original.pdf and result.pdf]
A snippet of code to help yuo understand:
PdfReader reader = new PdfReader(importedFile);
document.open();
PdfContentByte cb = writer.getDirectContent();
document.newPage();
PdfImportedPage imported = writer.getImportedPage(reader, 1);
cb.addTemplate(reader, 0, 0);
The offset (about 13mm in Y and 5mm in x on the A4 printed page) does not depend from document margins (I tried changing them), but with arguments 0,0 in method addTemplate this behaviour seems strange....
Thanks
Stefano
PS: maybe the problem/solution is known, I tried to look in the mail
archive but didn't find an answer
orig.pdf
Description: Adobe PDF document
result.pdf
Description: Adobe PDF document
