In an AcroForm (non XFA) PDF form, all the fields with the same name
share a single value.  In theory.  iText doesn't support this very well,
but it doesn't prevent it either.  iText won't create a parent field for
the value and make the existing fields children of that value, but it
also will use a single entry for the
AcroFields.getFieldItem("foo").getValue(n).

At any rate, combining multiple forms is one of the primary uses of
PdfStamper's flattening ability:

For Each Form
  Set the field values
  Flatten
  Append flattened PDF to combined pdf



--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 
 

> -----Original Message-----
> From: Greg Hile [mailto:g...@keepthemsmiling.com] 
> Sent: Thursday, August 19, 2010 5:18 AM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] iText-questions Digest, Vol 
> 51, Issue 49
> 
> So I have a set of PDF's that I fill out and then merge then 
> copy them into
> 1 pdf. They all have the same field names in them.
> 
> When I fill them out they fill out with no issues.
> For example a field called "FirstName" that is in several 
> places on each PDF is filled out in all the fields called 
> "FirstName" for each pdf.
>  
> But when I copy them to combine them into 1 pdf, "FirstName" 
> will be filled out on the first form, but not on the rest.
> 
> This is not universal either, for example if I have a field 
> called "CarColor" on several PDF's it will stay filled out on 
> all the PDFs when copied.
> 
>  
> 
> -----Original Message-----
> From: itext-questions-requ...@lists.sourceforge.net
> [mailto:itext-questions-requ...@lists.sourceforge.net]
> Sent: Thursday, August 19, 2010 5:43 AM
> To: itext-questions@lists.sourceforge.net
> Subject: iText-questions Digest, Vol 51, Issue 49
> 
> Send iText-questions mailing list submissions to
>       itext-questions@lists.sourceforge.net
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.sourceforge.net/lists/listinfo/itext-questions
> or, via email, send a message with subject or body 'help' to
>       itext-questions-requ...@lists.sourceforge.net
> 
> You can reach the person managing the list at
>       itext-questions-ow...@lists.sourceforge.net
> 
> When replying, please edit your Subject line so it is more 
> specific than "Re: Contents of iText-questions digest..."
> 
> 
> Today's Topics:
> 
>    1. itext PDF header signature not found. (tmiddlebrook)
>    2. Programmatically acessing a stamp in a PDF (curvenut)
>    3. Find string searchable pdf (wotikar)
>    4. Re: How to know if text should continue in next column
>       (1T3XT info)
>    5. Re: [iText-questions]
>       setViewerPreferences(PdfWriter.PrintScalingNone) does not work
>       (1T3XT info)
>    6. Re: PDF Landscape (Problem) (1T3XT info)
>    7. Re: PDF Header signature not found (1T3XT info)
>    8. Re: Programmatically acessing a stamp in a PDF (1T3XT info)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Wed, 18 Aug 2010 09:48:19 -0700 (PDT)
> From: tmiddlebrook <timothy.d.middlebr...@chase.com>
> Subject: [iText-questions] itext PDF header signature not found.
> To: itext-questions@lists.sourceforge.net
> Message-ID: <1282150099883-2330119.p...@n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> I am getting the PDF header signature not found error. I seen 
> in some posts I need to add "%PDF-1." and some post say I 
> need to subtract "%PDF-1". What do I need to do to get rid 
> this error? Either on the code side or on the pdf side. The 
> file I am using works sometimes but sometimes it throws this 
> error. Any suggestions?
> 
> Thanks in Advance.
> --
> View this message in context:
> http://itext-general.2136553.n4.nabble.com/itext-PDF-header-si
gnature-not-fo
> und-tp2330119p2330119.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Wed, 18 Aug 2010 09:26:28 -0700 (PDT)
> From: curvenut <yleungt...@csc.com>
> Subject: [iText-questions] Programmatically acessing a stamp in a PDF
> To: itext-questions@lists.sourceforge.net
> Message-ID: <1282148788487-2330098.p...@n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Hi,
> 
>    I have a PDF file that had a stamp. The stamp is created from
> Acrobat 7.0 the following way :
> 
>      Menu Tools > Commenting  >  Stamps > Dynamic Stamps > 
> 
> The stamps is inserted  randomly in the PDF document.
> 
> 
> I'd like to use itext API to access that stamp and read the 
> content that is
> in the stamp .
> 
> Is there a way t do it ??
> 
> 
> Thanks
> -- 
> View this message in context:
> http://itext-general.2136553.n4.nabble.com/Programmatically-ac
essing-a-stamp
> -in-a-PDF-tp2330098p2330098.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Thu, 19 Aug 2010 01:38:40 -0700 (PDT)
> From: wotikar <r-raki...@jazo.nl>
> Subject: [iText-questions] Find string searchable pdf
> To: itext-questions@lists.sourceforge.net
> Message-ID: <1282207120589-2330837.p...@n4.nabble.com>
> Content-Type: text/plain; charset=UTF-8
> 
> 
> 
> Hello,
> 
> I'm looking for a method to find a string in an searchable pdf with
> iTextSharp. I need to stamp pdf with a signature, but this 
> signature is not
> a the same location everytime. Therefor i need to search for 
> a string like
> "With kind regards," and at that position i need to add the signature.
> 
> Anybody who can help me with this?
> 
> Thanks in advance,
> 
> Ren?
> -- 
> View this message in context:
> http://itext-general.2136553.n4.nabble.com/Find-string-searcha
ble-pdf-tp2330
> 837p2330837.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Thu, 19 Aug 2010 11:26:02 +0200
> From: 1T3XT info <i...@1t3xt.info>
> Subject: Re: [iText-questions] How to know if text should continue in
>       next    column
> To: Post all your questions about iText here
>       <itext-questions@lists.sourceforge.net>
> Message-ID: <4c6cf8aa.30...@1t3xt.info>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Rune Hellem wrote:
> > I am creating a PDF-document of my blog, writing each post 
> one by one. 
> > The problem is when one of the posts have so much content that it 
> > exceeds the current column. The text will just disappear.
> 
> The remaining text is still in the ColumnText object,
> but you don't render it.
> 
> > I am not aware 
> > of any methods in class ColumnText that tells me that I now 
> have to much 
> > text.
> 
> Yes, you are aware of such a method.
> You are already using it in your code:
> 
> >                 status = ct.go(true);
> >                
> >                 // Need a new column?
> >                 if (ColumnText.hasMoreText(status)) {
> 
> If (ColumnText.hasMoreText(status)) is true, you still have content
> in your ColumnText object. That content needs to be rendered, or it
> will disappear. In the code that follows, you are missing a 
> go() method.
> 
> >                     column = (column + 1) % 2;
> >                     // Need a new page?
> >                     if (column == 0) {
> >                         document.newPage();
> >                         // Draw a line between the columns
> >                         drawColumnlines(writer);
> >                     }
> >                     // Create the colum
> >                     ct.setSimpleColumn(COLUMNS[column][0], 
> > COLUMNS[column][1],
> >                             COLUMNS[column][2], COLUMNS[column][3]);
> >                     y = COLUMNS[column][3];
> 
> HERE YOU NEED ANOTHER ct.go();
> but you'll need to rearrange the code in your loop,
> otherwise you'll overwrite that content with the next blog entry.
> 
> >                 }
> >                 // Reset and write the content to the PDF
> >                 ct.setYLine(y);
> >                 ct.setText(null);
> >                 addContent(ct, blogpost);
> >                 status = ct.go();
> > 
> > (...looking forward to the release of the new book later 
> this year :-) )
> > 
> > In advance
> > 
> > Rune
> > 
> > -- 
> > ****************************************************
> > Bored? Check out http://hellem.org/blog
> > ****************************************************
> > 
> > 
> > 
> --------------------------------------------------------------
> ----------
> > 
> >
> --------------------------------------------------------------
> --------------
> --
> > This SF.net email is sponsored by 
> > 
> > Make an app they can't live without
> > Enter the BlackBerry Developer Challenge
> > http://p.sf.net/sfu/RIM-dev2dev 
> > 
> > 
> > 
> --------------------------------------------------------------
> ----------
> > 
> > _______________________________________________
> > 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/
> 
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Thu, 19 Aug 2010 11:17:03 +0200
> From: 1T3XT info <i...@1t3xt.info>
> Subject: Re: [iText-questions]
>       setViewerPreferences(PdfWriter.PrintScalingNone) does not work
> To: Post all your questions about iText here
>       <itext-questions@lists.sourceforge.net>
> Message-ID: <4c6cf68f.1030...@1t3xt.info>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Lana Slisenko wrote:
> > When I try to do the following:
> >  
> > writer.setViewerPreferences(PdfWriter.PrintScalingNone);
> >  
> > I get 500 error "PdfWriter.PrintScalingNone cannot be resolved".
> 
> How were you able to compile your code if PdfWriter.PrintScalingNone 
> can't be resolved? Do you have the correct iText in your 
> CLASSPATH and 
> ONLY the correct iText (not two copies of a different version).
> 
> > Did you get rid of this preference and forgot to update the 
> > documentation? Is there a replacement for this?
> 
> If we would have gotten rid of it, you wouldn't have been able to 
> compile your code!
> 
> > I tried to  pass in (1 << 21) into the setViewerPreferences 
> method, I 
> > don't get an error, but the print dialog still displays 
> Page Scaling as 
> > "Shrink To Printable Area" instead of "None". I've also 
> found a post 
> > somewhere saying that it should be (1 << 24) - I've tried 
> that too - no 
> > luck.
> 
> Your problem is probably elsewhere.
> The 500 error tells me you're writing a web app.
> Try a standalone example and see if the problem persists.
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Thu, 19 Aug 2010 11:20:14 +0200
> From: 1T3XT info <i...@1t3xt.info>
> Subject: Re: [iText-questions] PDF Landscape (Problem)
> To: Post all your questions about iText here
>       <itext-questions@lists.sourceforge.net>
> Message-ID: <4c6cf74e.9060...@1t3xt.info>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Carlos Heitmann wrote:
> > How?
> 
> Create a PdfReader object, use it in a PdfStamper object.
> Get a PdfContentByte from the PdfStamper for a specific page.
> Stamp content on that page.
> 
> > and Where?
> 
> It's all documented in the 2nd edition of "iText in Action".
> 
> > I need an example or something more clear...
> 
> Plenty of examples in the book:
> http://itextpdf.com/book/
> 
> > Anyway thanx for help...was fast!
> 
> If you post a question to the list, we assume that you want to learn.
> Learning is done by reading the book ;-)
> 
> 
> 
> ------------------------------
> 
> Message: 7
> Date: Thu, 19 Aug 2010 11:40:34 +0200
> From: 1T3XT info <i...@1t3xt.info>
> Subject: Re: [iText-questions] PDF Header signature not found
> To: Post all your questions about iText here
>       <itext-questions@lists.sourceforge.net>
> Message-ID: <4c6cfc12.8060...@1t3xt.info>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> tmiddlebrook wrote:
> > I am getting the PDF header signature not found error. I 
> seen in some
> posts I
> > need to add "%PDF-1." and some post say I need to subtract 
> "%PDF-1". What
> do
> > I need to do to get rid this error? Either on the code side 
> or on the pdf
> > side. The file I am using works sometimes but sometimes it 
> throws this
> > error. Any suggestions? 
> 
> When you get such an error, you are trying to open a file 
> that IS NOT A 
> PDF. You may think you have created a PDF, you may even have 
> created a 
> PDF, but you are not opening a PDF.
> 
> Please explain the context.
> 
> For instance: if you are creating a PDF in a web application, the PDF 
> may have been created on the server, but the server is definitely 
> sending something else to the browser.
> 
> Most likely the server is sending a HTML page, for instance 
> with a 500 
> error message. Please read chapter 9 in the 2nd edition of iText in 
> Action and go over all the rules of thumb to see what could 
> have gone wrong.
> 
> 
> 
> ------------------------------
> 
> Message: 8
> Date: Thu, 19 Aug 2010 11:42:44 +0200
> From: 1T3XT info <i...@1t3xt.info>
> Subject: Re: [iText-questions] Programmatically acessing a stamp in a
>       PDF
> To: Post all your questions about iText here
>       <itext-questions@lists.sourceforge.net>
> Message-ID: <4c6cfc94.30...@1t3xt.info>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> curvenut wrote:
> > Hi,
> > 
> >    I have a PDF file that had a stamp. The stamp is created from
> > Acrobat 7.0 the following way :
> > 
> >      Menu Tools > Commenting  >  Stamps > Dynamic Stamps > 
> > 
> > The stamps is inserted  randomly in the PDF document.
> > 
> > 
> > I'd like to use itext API to access that stamp and read the 
> content that
> is
> > in the stamp .
> > 
> > Is there a way t do it ??
> 
> A stamp is an annotation.
> You need to loop over all the pages, and get the /Annots 
> entry from the 
> page dictionary. Then loop over all the annotations and check 
> if their 
> subtype is /Stamp. Read part 4 of the 2nd edition of "iText 
> in Action" 
> if you want to know more.
> 
> 
> 
> ------------------------------
> 
> --------------------------------------------------------------
> --------------
> --
> This SF.net email is sponsored by 
> 
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev 
> 
> ------------------------------
> 
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> 
> End of iText-questions Digest, Vol 51, Issue 49
> ***********************************************
> 
> 
> --------------------------------------------------------------
> ----------------
> This SF.net email is sponsored by 
> 
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev 
> _______________________________________________
> 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/
> 
> 

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
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/

Reply via email to