Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 10C73906F for ; Thu, 16 May 2013 21:14:22 +0000 (UTC) Received: (qmail 73680 invoked by uid 500); 16 May 2013 21:14:21 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 73619 invoked by uid 500); 16 May 2013 21:14:21 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 73611 invoked by uid 99); 16 May 2013 21:14:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 21:14:21 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ajoshi@arubanetworks.com designates 199.127.104.60 as permitted sender) Received: from [199.127.104.60] (HELO sjcbarracuda02.arubanetworks.com) (199.127.104.60) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 21:14:17 +0000 X-ASG-Debug-ID: 1368738835-03d13402534de930001-ulvbhl Received: from DIAMONDPEAK.arubanetworks.com ([10.1.8.23]) by sjcbarracuda02.arubanetworks.com with ESMTP id jnt2LF21e6W7ccLN (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO) for ; Thu, 16 May 2013 14:13:55 -0700 (PDT) X-Barracuda-Envelope-From: ajoshi@arubanetworks.com X-Barracuda-RBL-Trusted-Forwarder: 10.1.8.23 Received: from SODASPRINGS.arubanetworks.com ([fe80::d5b8:f896:7f06:1061]) by DIAMONDPEAK.arubanetworks.com ([::1]) with mapi id 14.02.0283.003; Thu, 16 May 2013 14:13:54 -0700 From: Asmita Joshi X-Barracuda-BWL-IP: fe80::d5b8:f896:7f06:1061 To: "users@pdfbox.apache.org" Subject: RE: IllegalArgumentException while converting pdf to jpg - pdfbox-app-1.8.1.jar Thread-Topic: IllegalArgumentException while converting pdf to jpg - pdfbox-app-1.8.1.jar X-ASG-Orig-Subj: RE: IllegalArgumentException while converting pdf to jpg - pdfbox-app-1.8.1.jar Thread-Index: AQHOUgHHraSIcm7HQ8ait5zE5Hl6UZkIIyMYgAAtPJM= Date: Thu, 16 May 2013 21:13:54 +0000 Message-ID: <80571428A122114FB97D9121E2FA886B01090FF99E@SODASPRINGS.arubanetworks.com> References: ,<80571428A122114FB97D9121E2FA886B01090FF93F@SODASPRINGS.arubanetworks.com> In-Reply-To: <80571428A122114FB97D9121E2FA886B01090FF93F@SODASPRINGS.arubanetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.8.202] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.1.8.23] X-Barracuda-Start-Time: 1368738835 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.2.1.21:8000/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at arubanetworks.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.131157 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Checked: Checked by ClamAV on apache.org Done - here it is: =0A= https://issues.apache.org/jira/browse/PDFBOX-1601=0A= =0A= thanks=0A= Asmita=0A= =0A= ------------------------=0A= Hmmm, I can't name one. Just create an issue in JIRA [1] and attach the PDF= in question.=0A= =0A= BR=0A= Andreas Lehmk=FChler=0A= =0A= [1] http://issues.apache.org/jira/browse/PDFBOX=0A= =0A= =0A= ________________________________________=0A= From: Asmita Joshi=0A= Sent: Thursday, May 16, 2013 11:33 AM=0A= To: users@pdfbox.apache.org=0A= Subject: RE: IllegalArgumentException while converting pdf to jpg - pdfbox-= app-1.8.1.jar=0A= =0A= Yeah you're right. I just tried it myself. Do you know of any other place w= here I can upload a pdf?=0A= =0A= -------------------------=0A= =0A= Hi,=0A= =0A= Am 16.05.2013 16:55, schrieb Asmita Joshi:=0A= > Here is the PDF file that fails to load correctly with PDDocument.load or= loadNonSeq=0A= >=0A= > http://www.scribd.com/doc/141881157/Failing-to-Load?secret_password=3D1or= cf1jmzt70o7it24s9=0A= The pdf can't be downloaded without a registration :-(=0A= =0A= BR=0A= Andreas Lehmk=FChler=0A= =0A= ________________________________________=0A= From: Maruan Sahyoun [sahyoun@fileaffairs.de]=0A= Sent: Monday, May 13, 2013 11:47 PM=0A= To: users@pdfbox.apache.org=0A= Subject: Re: IllegalArgumentException while converting pdf to jpg - pdfbox-= app-1.8.1.jar=0A= =0A= Hi Asmita,=0A= =0A= could you upload the PDF to a location from where we can download it? Didn'= t make it through the mailing list.=0A= =0A= BR=0A= Maruan Sahyoun=0A= =0A= Am 13.05.2013 um 22:09 schrieb Asmita Joshi :=0A= =0A= > We use PDDocument.load(File). As suggested, we tried with loadNonSeq and = also the non sequential form of load as below. Also tried it with a FileInp= utStream and File. All these forms of load gave us the same error.=0A= > ---=0A= > raf =3D new RandomAccessFile(new File("/tmp/nonSeqPdfFile"), "rw= ");=0A= > document =3D PDDocument.load(new FileInputStream(inputFile), raf= );=0A= > PDFImageWriter imageWriter =3D new PDFImageWriter();=0A= > success =3D imageWriter.writeImage(document, imageFormat, pass= word, startPage, endPage, pdfWorkFilePrefix, imageType, resolution);=0A= > ---=0A= > Attaching one of the pdfs that causes this issue.=0A= >=0A= > Thanks=0A= > Asmita=0A= >=0A= > ________________________________________=0A= > From: Maruan Sahyoun [sahyoun@fileaffairs.de]=0A= > Sent: Monday, May 06, 2013 9:38 PM=0A= > To: users@pdfbox.apache.org=0A= > Subject: Re: IllegalArgumentException while converting pdf to jpg - pdfbo= x-app-1.8.1.jar=0A= >=0A= > Hi Asmita,=0A= >=0A= > how did you load the PDF. DId you use PDDocument.load or PDDocument.loadN= onSeq? If it's PDDocument.load could you try PDDocument.loadNonSeq instead.= Can you share a code snippet with us showing how you are converting the PD= F? Is there a sample PDF?=0A= >=0A= > BR=0A= > Maruan Sahyoun=0A= >=0A= > Am 07.05.2013 um 00:44 schrieb Asmita Joshi := =0A= >=0A= >> We're using pdfbox-1.8.1.jar to convert PDF to JPGs.=0A= >> Below is part of a stacktrace we see when converting a PDF of size 500Kb= =0A= >>=0A= >> java.lang.IllegalArgumentException: Width (4032) and height (-2880) cann= ot be <=3D 0=0A= >> at java.awt.image.DirectColorModel.createCompatibleWritableRaster(= Unknown Source)=0A= >> at java.awt.image.BufferedImage.(Unknown Source)=0A= >> at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:752= )=0A= >> at org.apache.pdfbox.util.PDFImageWriter.writeImage(PDFImageWriter= .java:115)=0A= >>=0A= >>=0A= >> ----------------=0A= >> This is the header and footer of the PDF file:=0A= >> %PDF-1.4=0A= >> %=0A= >> 1 0 obj=0A= >> <<=0A= >> /Type /Pages /Count 1 /Kids [ 8 0 R ]=0A= >>>>=0A= >> endobj=0A= >> 2 0 obj=0A= >> <<=0A= >> /Type /Catalog /ViewerPreferences <<=0A= >> /NonFullScreenPageMode /UseOutlines >>=0A= >> /Pages 1 0 R >>=0A= >> endobj=0A= >> 3 0 obj=0A= >> <<=0A= >> /Producer (PDF-XChange \(xcpro30.dll v3.40.0074\) \(Windows 2k\))=0A= >> /CreationDate (D:20050311152944-06'00')=0A= >> /Author ()=0A= >> /Title ()=0A= >> /Subject ()=0A= >> /Keywords ()=0A= >> /Creator (AcroPlot Pro \(Build 2005-02-07\) - www.cadzation.com)=0A= >>>>=0A= >> endobj=0A= >> 4 0 obj=0A= >> <>>>=0A= >> stream=0A= >>=0A= >> ........................................................................= ........=0A= >>=0A= >> endstream=0A= >> endobj=0A= >> 8 0 obj=0A= >> <<=0A= >> /Type /Page /Parent 1 0 R /Resources <<=0A= >> /Font <<=0A= >> /F1 6 0 R >>=0A= >>>>=0A= >> /MediaBox [ 0 2160 3024 0 ]=0A= >> /Contents [ 7 0 R ]=0A= >>>>=0A= >> endobj=0A= >> xref=0A= >> 0 9=0A= >> 0000000000 65535 f=0A= >> 0000000013 00000 n=0A= >> 0000000076 00000 n=0A= >> 0000000192 00000 n=0A= >> 0000000441 00000 n=0A= >> 0000009708 00000 n=0A= >> 0000009989 00000 n=0A= >> 0000010386 00000 n=0A= >> 0000583350 00000 n=0A= >> trailer=0A= >> <<=0A= >> /Size 9 /Info 3 0 R /Root 2 0 R /ID [ <6A5A32742A221E93F44AD2E93D4134B2>= =0A= >> <6A5A32742A221E93F44AD2E93D4134B2>=0A= >> ]=0A= >>>>=0A= >> startxref=0A= >> 583492=0A= >> %%EOF=0A= >>=0A= >>=0A= >> -------------------=0A= >> Is this a bug? The PDF file opens correctly in adobe. So probably it is = not corrupt.=0A= >>=0A= >> Thanks=0A= >> Asmita=0A= >=0A= =0A=