> > 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. Ahh, thanks for that, I didn't realise XFA and AcroForm/FDF forms could co-exist. If I understand correctly, mergeXfaData() will ignore XFA form elements if there are FDF form elements, and fill in those instead, is that right? > 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. I've tried throwing away the XFA part after calling mergeXfaData(), and yes the final PDF does have the fields filled in, and mis-aligned. So it looks like we know what the problem is now. I'm not sure what the solution is though, it looks like there isn't a way to tell mergeXfaData() to ignore the AcroForm and fill in the XFA. Is the only answer to try getting Acrobat Pro to create the initial PDF without the AcroForm part, so that iText will not find any FDF form elements, and so will merge into the XFA form elements? Or is there some way to get iText to either remove, or ignore the AcroForm part and fill in the XFA part instead? Thanks again for your help, it's much appreciated. Adam Carless The contents of this message and any attachments are confidential and are intended for the use of the persons to whom it is addressed. If you are not the intended recipient, you should not copy, forward, use or alter the message in any way, nor disclose its contents to any other person. Please notify the sender immediately and delete the e-mail from your system, if you so wish you can contact us on +44 1624 688000. The sender is not responsible for any alterations that may have occurred without authorisation. Any files attached to this email will have been checked by us with virus detection software before transmission. You should carry out your own virus checks before opening any attachments, as we do not accept any liability for loss or damage which may be caused by viruses. For information regarding company registration please visit the contact page at www.hansard.com ------------------------------------------------------------------------------ _______________________________________________ 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/