Return-Path: Delivered-To: apmail-incubator-pdfbox-dev-archive@minotaur.apache.org Received: (qmail 75501 invoked from network); 13 Aug 2009 10:39:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Aug 2009 10:39:30 -0000 Received: (qmail 459 invoked by uid 500); 13 Aug 2009 10:39:37 -0000 Delivered-To: apmail-incubator-pdfbox-dev-archive@incubator.apache.org Received: (qmail 438 invoked by uid 500); 13 Aug 2009 10:39:37 -0000 Mailing-List: contact pdfbox-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pdfbox-dev@incubator.apache.org Delivered-To: mailing list pdfbox-dev@incubator.apache.org Received: (qmail 428 invoked by uid 99); 13 Aug 2009 10:39:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2009 10:39:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2009 10:39:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C70CC234C004 for ; Thu, 13 Aug 2009 03:39:14 -0700 (PDT) Message-ID: <336247971.1250159954800.JavaMail.jira@brutus> Date: Thu, 13 Aug 2009 03:39:14 -0700 (PDT) From: "Chris Bowditch (JIRA)" To: pdfbox-dev@incubator.apache.org Subject: [jira] Created: (PDFBOX-504) Can't Parse any PDF using IBM JDK MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Can't Parse any PDF using IBM JDK --------------------------------- Key: PDFBOX-504 URL: https://issues.apache.org/jira/browse/PDFBOX-504 Project: PDFBox Issue Type: Bug Components: Parsing Affects Versions: 0.8.0-incubator Environment: RedHat Linux IBM JDK Reporter: Chris Bowditch Priority: Critical All PDF (that I have tried) fail to parse using IBM JDK 1.5 on RedHat Linux= . The error you receive is: Exception in thread "main" java.io.IOException: Error: Expected an integer = type, actual=3D'=C3=83=C2=A3=C3=83=C3=83' at org.apache.pdfbox.pdfparser.BaseParser.readInt(BaseParser.java:1= 220) at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java= :493) at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:172) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:736) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:704) at org.apache.pdfbox.PDFReader.parseDocument(PDFReader.java:323) at org.apache.pdfbox.PDFReader.openPDFFile(PDFReader.java:286) at org.apache.pdfbox.PDFReader.main(PDFReader.java:271) Although after debugging the actual error is hidden: java.io.IOException: Error: Expected an integer type, actual=3D'=C3=A3=C3= =8F=C3=93' at org.apache.pdfbox.pdfparser.BaseParser.readInt(BaseParser.java:1= 220) at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java= :483) at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:172) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:736) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:704) at org.apache.pdfbox.PDFReader.parseDocument(PDFReader.java:323) at org.apache.pdfbox.PDFReader.openPDFFile(PDFReader.java:286) at org.apache.pdfbox.PDFReader.main(PDFReader.java:271) The characters shown in the hidden message occur at the start of most PDF F= iles that I have checked: %PDF-1.4 %=C3=A2=C3=A3=C3=8F=C3=93 6 0 obj <> stream Tracing the code I can see the problem is down to the skipToNextObject() me= thod in PDFParser class. This method is new since v0.7.4. The code converts the array of 16 bytes to a String. The characters =C3=A2= =C3=A3=C3=8F=C3=93 are read as negative numbers in both Sun and IBM JDKs bu= t whilst on Sun the String created from the byte array contains the charact= ers on IBM JDK these characters are missing from the String. So when you re= ad back 16 characters the stream offset is incorrect. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.