There's one close() too many, just call doc.close().

Paulo 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Cesare Cantieri
> Sent: Thursday, April 24, 2008 1:48 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] adobe reader error 109
> 
> Hello, I'm sorry, I come again with a question of a few days 
> ago, about 
> which I did not get a final answer probably because I was not able to 
> provide you all the information correctly.
> 
> I use attached code to manipulate an existing pdf (the code actually 
> doesn't change anything, just copies the document into 
> another, but it 
> is enough to produce the problem).
> When opening the resulting pdf with acrobat reader (I tried 
> last version 
> and some others), I get the message "Error during page elaboration. A 
> problem occured during reading this document (109)".
> 
> I attach the the source pdf to be copied (original.pdf), and a sample 
> class which does the job (Copier.java).
> 
> Any help would be really appreciated. thank you.
> 
> --cesare
> 
> 
> Paulo Soares wrote:
> > I need the original PDF.
> >
> > Paulo 
> >
> >   
> >> -----Original Message-----
> >> From: [EMAIL PROTECTED] 
> >> [mailto:[EMAIL PROTECTED] On 
> >> Behalf Of Cesare Cantieri
> >> Sent: Tuesday, April 15, 2008 7:48 AM
> >> To: Post all your questions about iText here
> >> Subject: Re: [iText-questions] adobe reader error 109
> >>
> >> I understand, attached is the PDF which is problematic with 
> >> adobe reader.
> >> thank you
> >> --cesare
> >>
> >> Paulo Soares wrote:
> >>     
> >>> You know that asking this without posting the PDF won't get you
> >>> anywhere, don't you?
> >>>
> >>> Paulo 
> >>>
> >>>   
> >>>       
> >>>> -----Original Message-----
> >>>> From: [EMAIL PROTECTED] 
> >>>> [mailto:[EMAIL PROTECTED] On 
> >>>> Behalf Of Cesare Cantieri
> >>>> Sent: Monday, April 14, 2008 4:39 PM
> >>>> To: [email protected]
> >>>> Subject: [iText-questions] adobe reader error 109
> >>>>
> >>>> I have been using IText from a few days, it allowed me to 
> >>>> produce nice 
> >>>> pdf tested with Evince 0.5.2. But, when I tested them 
> using Adobe 
> >>>> Acrobat Reader 8 I got the following error:
> >>>> "Error during page elaboration. A problem occured during 
> >>>>         
> >> reading this 
> >>     
> >>>> document (109)" and I cannot see the document correctly.
> >>>> In my code I use Flying Saucer to create a pdf document from 
> >>>> HTML (works 
> >>>> fine in any reader)
> >>>> then I use following code to manipulate the Flying Saucer output 
> >>>> (following code actually doesn't change anyting, just copies the 
> >>>> document into another, but it is enough to produce the problem):
> >>>>
> >>>>
> >>>> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> >>>> Document doc = new Document();
> >>>> PdfWriter copy = PdfWriter.getInstance(doc, baos);
> >>>> doc.open();
> >>>> PdfReader reader = new 
> >>>> PdfReader(PDF_FromFlyingSaucer_Baos.toByteArray());
> >>>> PdfContentByte cb = copy.getDirectContent();       for (int p 
> >>>> = 1; p <= 
> >>>> reader.getNumberOfPages(); p++) {
> >>>> doc.newPage();
> >>>> PdfImportedPage page = copy.getImportedPage(reader, p);
> >>>> cb.addTemplate(page, 0, 0);
> >>>> copy.close();
> >>>> doc.close();
> >>>> baos.close();
> >>>>
> >>>>
> >>>> Where am I wrong? note that into the 
> >>>> PDF_FromFlyingSaucer_Baos there is 
> >>>> text and graphics (HTML tables converted by Flying Saucer).
> >>>>
> >>>> Thank you very much for help
> >>>> --cesare


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