That shouldn't happen. Can you send me the pdf?
Best Regards,
Paulo Soares
----- Original Message -----
From: "zugasti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 02, 2004 16:07
Subject: [iText-questions] Problem concatenating pdf file with a blank page
> The program fails with this exception when i try to concatenate pdf files
with
> a blank page:
>
> java.lang.NullPointerException
> at com.lowagie.text.pdf.PRStream.<init>(Unknown Source)
> at com.lowagie.text.pdf.PdfReaderInstance.getFormXObject(Unknown
> Source)
> at com.lowagie.text.pdf.PdfImportedPage.getFormXObject(Unknown Source)
> at com.lowagie.text.pdf.PdfReaderInstance.writeAllPages(Unknown Source)
> at com.lowagie.text.pdf.PdfWriter.addSharedObjectsToBody(Unknown
> Source)
> at com.lowagie.text.pdf.PdfWriter.close(Unknown Source)
> at com.lowagie.text.pdf.PdfDocument.close(Unknown Source)
> at com.lowagie.text.Document.close(Unknown Source)
>
> The problem comes from the following method vhen the contents variable is
null:
>
> PdfStream getFormXObject(int pageNumber) throws IOException {
> PdfDictionary page = pages[pageNumber - 1];
> PdfObject contents = PdfReader.getPdfObject(page.get
> (PdfName.CONTENTS));
> PdfDictionary dic = new PdfDictionary();
> byte bout[] = null;
> ArrayList filters = null;
> if (contents != null) {
> if (contents.isStream()) {
> dic.putAll((PRStream)contents);
> }
> else {
> bout = reader.getPageContent(pageNumber, file);
> }
> }
> dic.put(PdfName.RESOURCES, PdfReader.getPdfObject(page.get
> (PdfName.RESOURCES)));
> dic.put(PdfName.TYPE, PdfName.XOBJECT);
> dic.put(PdfName.SUBTYPE, PdfName.FORM);
> PdfImportedPage impPage = (PdfImportedPage)importedPages.get(new
> Integer(pageNumber));
> dic.put(PdfName.BBOX, new PdfRectangle(impPage.getBoundingBox()));
> PdfArray matrix = impPage.getMatrix();
> if (matrix == null)
> dic.put(PdfName.MATRIX, IDENTITYMATRIX);
> else
> dic.put(PdfName.MATRIX, matrix);
> dic.put(PdfName.FORMTYPE, ONE);
> PRStream stream;
> if (bout == null) {
> stream = new PRStream((PRStream)contents, dic);
> }
> else {
> stream = new PRStream(reader, bout);
> stream.putAll(dic);
> }
> return stream;
> }
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by Black Hat Briefings & Training.
> Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
> digital self defense, top technical experts, no vendor pitches,
> unmatched networking opportunities. Visit www.blackhat.com
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions