I would like to see the PDF that causes the error. Paulo
----- Original Message ----- From: "nando.dev" <[EMAIL PROTECTED]> To: <itext-questions@lists.sourceforge.net> Sent: Tuesday, August 28, 2007 6:31 PM Subject: [iText-questions] Patch for PdfStamperImp > Hi, > I'd found a problem when using iText to add text over an existing > pdf document throwed a ClassCastException. I'd correct this problem in > iText 2.0.4. > I send a patch which resolve this problem. > Bye, > > > > Index: > /datos/workspace/iText-core/src/com/lowagie/text/pdf/PdfStamperImp.java > =================================================================== > --- > /datos/workspace/iText-core/src/com/lowagie/text/pdf/PdfStamperImp.java > (revision > 2900) > +++ > /datos/workspace/iText-core/src/com/lowagie/text/pdf/PdfStamperImp.java > (working > copy) > @@ -201,7 +201,10 @@ > try { > file.reOpen(); > alterContents(); > - iInfo = > (PRIndirectReference)reader.trailer.get(PdfName.INFO); > + PdfObject pdfObject = reader.trailer.get(PdfName.INFO); > + if (pdfObject instanceof PRIndirectReference){ > + iInfo = (PRIndirectReference) pdfObject; > + } > int skip = -1; > if (iInfo != null) > skip = iInfo.getNumber(); ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/