freeReader() makes the writer instance forget about that particular pdf. You may open the same pdf again but it will be like a different pdf and won't use any of the shared resources from the first one that you could use if the pdf was not freed. freeReader() is meant to be used when you're done with the doc, not if you intend to use it later.
Paulo ________________________________ From: 'Kevin Day' [[email protected]] Sent: Thursday, April 29, 2010 12:55 AM To: IText Questions Subject: [iText-questions] Clarification on PdfCopy.freeReader() I'm trying to get a handle on the implications of using the freeReader() call of PdfCopy. If I call this, can I not add more pages from the 'freed' reader to the same PdfCopy instance? Or is it safe to call: pdfCopy.freeReader(myReader); PdfImportedPage imported = pdfCopy.getImportedPage(myReader, 1); pdfCopy.addPage(imported); pdfCopy.freeReader(myReader); PdfImportedPage imported = pdfCopy.getImportedPage(myReader, 2); pdfCopy.addPage(imported); Obviously, in a real app, these calls would not be in the same block of code. This is kind of a long way of asking if it wouldn't be better to just implicitly call freeReader() in addPage() if the reader is different from the currentReader. I suspect that this would have performance implications for readers opened in partial mode, but I wanted to check my thinking. Thanks, - K 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.
------------------------------------------------------------------------------
_______________________________________________ iText-questions mailing list [email protected] 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/
