Wasn't this fixed a long time ago?
Which version are you using?

On 5/12/2012 0:31, Adam Field wrote:
Hi again. We're using itextsharp to fill in user's forms. One user complained to us that their form fields were aligned perfectly with other elements on the page, but after our application modified a field's value, the text in that field moved a couple pixels down. I poked around at the source and the pdf specifications for a bit, but I'm by no means an expert in either, and this seems more like a bug (albeit a minor one - nobody else has complained) than user error. That particular user hasn't authorized us to share their pdf - but I grabbed a random pdf I had lying around for test purposes, and filling in a random field on that test pdf moved its text a pixel to the left. So it's not just that one user's pdf - seems like calling SetField() can get results from GetAppearance() that aren't quite aligned with the field's previous location. If you were to open the resulting pdf, edit that field, then click back off, it goes back to its original, correct location, so it doesn't seem like information incorrectly obtained from the input, either, but information autogenerated subtly incorrectly?

Simple test code:

using (FileStream fileStream = new FileStream("output.pdf", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite))
            {
                PdfReader reader = new PdfReader("input.pdf");
PdfStamper stamper = new PdfStamper(reader, fileStream, reader.PdfVersion, true);
                stamper.AcroFields.SetField(this.uxFieldName.Text, "aaa");
                stamper.Close();
            }

Run that on the attached test pdf, compare the locations of the Last Name field on the left of the input and resulting output. Shouldn't they be the same? If anyone more knowledgeable about itextsharp could find the bug, or barring that, let me know why it isn't one, I'd be most appreciative.
Thanks (in advance)!


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d


_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to