I ended making the fields read-only

What I'm doing is taking a set of text fields placed at the top of the page
as a row, and copying them several times down as a table. So these copied
fields are not flattened and I tried as you said recreate them adding
content with the stamper.

But it doesn't work very well, acrobat reader doesn't like new added text,
there isn't problem replicating the rectangle but the text using the same
font, size and position... it just doesn't appear. Opening the document with
adobe pro I realized that the text was actually added but you can't see it,
I had to make a "Select All" with the graphics editing tool and then I saw
it highlighted, the re-sized the text rectangle and there was the text,
perfect font, perfect size but not exactly in the desired position, a little
moved.

Anyway, if somebody wants to know how to copy an existing text field with
IText, I tell you that AcroFields.decodeGenericDictionary() method is your
friend, you can create a new text field and then copy all the
widget appearance from the the original field taking its merged dictionary.

Greets,

2011/6/29 José Carrizo <c4rr...@gmail.com>

> Well, actually there is a case where I need to do it but does not matter,
> you are right, I'll try to do it that way.
>
> Thanks so much.
>
> El jun 29, 2011 3:39 a.m., "1T3XT BVBA" <i...@1t3xt.info> escribió:
>
> >
> > On 29/06/2011 1:55, José Carrizo wrote:
> >>
> >> Hello there,
> >>
> >> I would like to know why the code documentation of iText says "The
> fields added with addAnnotation(PdfAnnotation, int) will never be
> flattened".
> >>
> >> I need to do that, flatten a field that has been just created with
> iText, whats the reason for that restriction.
> >
> >
> > 1. A field that has been added to an existing PDF can be flattened in a
> second pass.
> > 2. It doesn't make sense to add a field, and then immediately flatten it.
> Just add the content!
> >
> >
> ------------------------------------------------------------------------------
> > All of the data generated in your IT infrastructure is seriously
> valuable.
> > Why? It contains a definitive record of application performance, security
> > threats, fraudulent activity, and more. Splunk takes this data and makes
> > sense of it. IT sense. And common sense.
> > http://p.sf.net/sfu/splunk-d2d-c2
> > _______________________________________________
> > iText-questions mailing list
> > iText-questions@lists.sourceforge.net
> > 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
>
>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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