I think I have a solution to this that fits my needs. If I fill out the form
by manipulating the "XFA" xml document data and marking it "Changes" instead
of using the stamper, the text has the right margins and is aligned
correctly. It even works correctly with documents that have reader rights
enabled.
In the chapter on PDF history in the book there is a page detailing what XFA
and XFA forms are. If I understand it correctly, XFA will only work in Adobe
7 or greater - opening the form in Adobe 6 will fail or show blank/default
fields.
Since I have already set Adobe 7 as the minimum version due to other
form/scripting requirements, this seems like a good solution to me. Is there
any other obvious gotcha I might be missing - I don't remember seeing any
reference to XFA when I was searching for a solution initially? I'm
including a sample of what I'm doing to fill out a field with XFA (C#).
PdfReader reader = new PdfReader("c:\\input.pdf");
PdfStamper stamper = new PdfStamper(reader, new FileStream("c:\\output.pdf",
FileMode.Create), '\0', true);
// Should really be done with an xpath selection statement, not harded node
indexes
stamper.AcroFields.Xfa.DatasetsNode.ChildNodes[0].ChildNodes[0].ChildNodes[0].InnerText
= "This is the first field in the document";
stamper.AcroFields.Xfa.Changed = true;
stamper.Close();
reader.Close();
--
View this message in context:
http://www.nabble.com/Vertical-alignment-of-multiline-form-fields-tp14197897p18654123.html
Sent from the iText - General mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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