> 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. Wow - that i call high quality help :)
I found the bug - for radiobuttons and checkboxes the 'Q' in the appearance was missing and thus the graphics state wasn't restored! And since i implemented it - it was easy to fix. Thanks for the hint, ToM > > Paulo > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On > > 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) ------------------------------------------------------------------------- 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
