Adam Carless wrote: > I have a PDF which has been created using Adobe Acrobat Pro (not sure which > version). This PDF contains a single XFA form with various form fields, some > of > which are inline with static text. > When the PDF is opened in Acrobat Reader, and the form fields are filled in > by > hand, the values appear correctly aligned with the surrounding text. It all > works as expected. > > However, when I fill the fields using > PdfStamper.getAcroFields().mergeXfaData(Document) the values appear to be > dropped slightly, so they appear approximately 1.5mm low on the page. Also > the > whole page alignment seems to be altered slightly, with the top and bottom > margins becoming wider.
Sounds like you have a form with an XFA form that has an AcroForm counter-part. In that case, iText ignores the XFA and fill out the AcroForm fields which have a slightly different alignment, scaling, etc. > I've tried this both using and not using encryption, compression, and form > flattening, and the results are the same. > > Also, when I check the various "boxes" of the reader object before and after > the > merge, the rectangle values all seem to be the same. So I don't think the box > sizes are being manipulated by the merging process. Throw away the XFA part using stamper.getAcroFields().removeXfa(); after you've merged the XFA data and you'll see that the AcroFields are different than the (removed) XFA fields. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ 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/