So, in the interest of honesty, I do admit that the user who complained
about this issue to us doesn't, and for unrelated reasons, can't use the
latest version of itextsharp. Still, I've been listening to this list long
enough to know that that is not the right answer, so before I bothered you
with a bug that might well have been fixed, I immediately yesterday made
sure it wasn't by trying the same test on the trunk after updating, which
showed the same slightly-off field text for both the user's pdf field and
the test one. I just made *completely *sure; I downloaded a fresh copy of
itextsharp directly from svn from sourceforge, which identifies itself as
AssemblyVersion 5.3.4. I can still reproduce both using that fresh copy I
just compiled. Hopefully you won't feel like spiting me for having to use
an old version so much that you wouldn't look into a bug that's still
easily reproduceable? (At least I hope it is; otherwise I'm going crazy...)
On Tue, Dec 4, 2012 at 11:13 PM, 1T3XT BVBA <[email protected]> wrote:
> 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.
>
>
------------------------------------------------------------------------------
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