The problem is with some fields that have a save state but not a restore state. 
Acrobat 7 gets confused with it but Acrobat 8 has a better isolation and one 
field doesn't mess with the other. For the fields that you don't set call 
AcroFields.regenerateField() to create a new appearance and get rid of the 
error.

Paulo 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Tobias Meier
> Sent: Monday, April 14, 2008 12:58 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Strange 
> visualization/printingproblems inAcrobat (Reader) 7
> 
> Thanks for the hint and sorry for the lacking details.
> > Flatten first and then concatenate, that's what my crystal 
> ball says.
> I do it in that order...
> 
> CODE:
> 
> //new PDF Document
> Document finalPdf = new Document();
>                
> //if forms are flattened then PDF-Smart-Copy is used
> PdfCopy copier = new PdfSmartCopy(this.finalPdf, outputstream);
>                
> //Start adding pdfs
> this.finalPdf.open();
> 
> -------------------------------------loop for several docs
> <start>---------------------------------
> 
> //initialize Reader
> PdfReader reader = new PdfReader(pdfDocument);
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> 
> //1. flatten the forms
> PdfStamper stamper = new PdfStamper(reader, baos);
> stamper.setFormFlattening(true);
> stamper.close();
> stamper=null;
>                    
> //initialize Reader with the flatted version
> reader = new PdfReader(baos.toByteArray());
>                
> //2. Concatate
> for (int i = 1; i <= reader.getNumberOfPages(); i++) {
>      copier.addPage(this.copier.getImportedPage(reader,i));
> }
> 
> -------------------------------------loop for several docs
> <end>---------------------------------
> 
> //3. close
> this.finalPdf.close();
> this.copier.close();   
> 
> This is basically what i am doing. I attached the original 
> PDF with the
> fields
> still intact.
> 
> Thanks for looking!
> ToM
> 
> 
> 
> > You don't give details on your original PDF or the way you are
> > concatenating them, when they are filled, etc.
> >
> > Paulo
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On
> > > Sent: Monday, April 14, 2008 10:30 AM
> > > To: Post all your questions about iText here
> > > Subject: [iText-questions] Strange visualization/printing
> > > problems inAcrobat (Reader) 7
> > >
> > > Hi,
> > >
> > > i experience some strange behaviour after i concatenating and
> > > flattening
> > > a pdf.
> > > In Acrobat Reader 8 all works fine but in Acrobat Reader 7 (.0.9)
> > > sometimes the content of the "ex"-form fields is gone.
> > > It is just sporadic - meaning if you scroll down and up several
> > > times
> > > the text/checkboxes/radiobuttons/buttons (everything is affected)
> > > sometimes appear/disappear (and sometimes is half-cut). In Acrobat
> > > (Reader) 8 i could not reproduce the problem. But since 
> some of our
> > > clients still use 7 we have to support it...
> > > Printing is also affected - the cross of the checkboxes 
> and the text
> > > appears somewhere on the page but not in the right place. Does
> > > anybody
> > > know what's going on?
> > >
> > > I attached the PDF and Screenshots of the missing content.
> > >
> > > Thanks for helping,
> > > ToM
> > >
> > > OriginalWithAnnots.png - what the original should look like (with
> > > some
> > > green annotations made by me for explanation purposes)
> 


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to