You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "Hesham G." <he...@gmail.com> on 2009/08/12 14:55:33 UTC

Error reading a PDF

Hi there ,

I'm trying to read the attached PDF using PDFTextStripper.
The 1st page is read fine, but reading page(2) or (3) causes this Exception :
   An exception occurred: java.lang.ArrayIndexOutOfBoundsException

Any idea why this happens, I don't see any problems with these pages !!

Thanks ,
Hesham

Re: Error reading a PDF

Posted by "Hesham G." <he...@gmail.com>.
Here is the stack trace :
java.lang.ArrayIndexOutOfBoundsException: 4
	at org.fontbox.cmap.CMapParser.parseNextToken(CMapParser.java:294)
	at org.fontbox.cmap.CMapParser.parseNextToken(CMapParser.java:233)
	at org.fontbox.cmap.CMapParser.parse(CMapParser.java:129)
	at org.pdfbox.pdmodel.font.PDFont.parseCmap(PDFont.java:535)
	at org.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:387)
	at org.pdfbox.util.PDFStreamEngine.showString(PDFStreamEngine.java:325)
	at org.pdfbox.util.operator.ShowTextGlyph.process(ShowTextGlyph.java:80)
	at 
org.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:452)
	at 
org.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:215)
	at org.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:174)
	at org.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:336)
	at org.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:259)
	at org.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:216)
	at org.pdfbox.util.PDFTextStripper.getText(PDFTextStripper.java:149)

--------------------------------------------------
From: "Daniel Wilson" <wi...@gmail.com>
Date: Wednesday, August 12, 2009 5:33 PM
To: <pd...@incubator.apache.org>
Subject: Re: Error reading a PDF

> Do you have the full stack trace?  The exception itself isn't telling me
> that much.
>
> On Wed, Aug 12, 2009 at 9:52 AM, Hesham G. <he...@gmail.com> wrote:
>
>> Thanks Daniel ,
>>
>> I'll try the latest version now. But can you tell me why this Exception
>> occurred in PDFBox so I can know what I'm looking for ?
>>
>> Thanks ,
>> Hesham
>>
>> --------------------------------------------------
>> From: "Daniel Wilson" <wi...@gmail.com>
>> Date: Wednesday, August 12, 2009 4:37 PM
>> To: <pd...@incubator.apache.org>
>> Subject: Re: Error reading a PDF
>>
>>
>>  Are you using the trunk version (compiling from latest code) or an older
>>> version?  If older, please try the latest.
>>>
>>> Thanks.
>>> Daniel
>>>
>>> 2009/8/12 Hesham G. <he...@gmail.com>
>>>
>>>   Hi there ,
>>>>
>>>> I'm trying to read the attached PDF using PDFTextStripper.
>>>> The 1st page is read fine, but reading page(2) or (3) causes this
>>>> Exception
>>>> :
>>>>   An exception occurred: java.lang.ArrayIndexOutOfBoundsException
>>>>
>>>> Any idea why this happens, I don't see any problems with these pages !!
>>>>
>>>> Thanks ,
>>>> Hesham
>>>>
>>>>
>>>
> 

Re: Error reading a PDF

Posted by "Hesham G." <he...@gmail.com>.
Thanks Daniel ... I've tried the FontBox latest version & the problem is 
fixed in it.

Hesham

--------------------------------------------------
From: "Daniel Wilson" <wi...@gmail.com>
Date: Wednesday, August 12, 2009 5:33 PM
To: <pd...@incubator.apache.org>
Subject: Re: Error reading a PDF

> Do you have the full stack trace?  The exception itself isn't telling me
> that much.
>
> On Wed, Aug 12, 2009 at 9:52 AM, Hesham G. <he...@gmail.com> wrote:
>
>> Thanks Daniel ,
>>
>> I'll try the latest version now. But can you tell me why this Exception
>> occurred in PDFBox so I can know what I'm looking for ?
>>
>> Thanks ,
>> Hesham
>>
>> --------------------------------------------------
>> From: "Daniel Wilson" <wi...@gmail.com>
>> Date: Wednesday, August 12, 2009 4:37 PM
>> To: <pd...@incubator.apache.org>
>> Subject: Re: Error reading a PDF
>>
>>
>>  Are you using the trunk version (compiling from latest code) or an older
>>> version?  If older, please try the latest.
>>>
>>> Thanks.
>>> Daniel
>>>
>>> 2009/8/12 Hesham G. <he...@gmail.com>
>>>
>>>   Hi there ,
>>>>
>>>> I'm trying to read the attached PDF using PDFTextStripper.
>>>> The 1st page is read fine, but reading page(2) or (3) causes this
>>>> Exception
>>>> :
>>>>   An exception occurred: java.lang.ArrayIndexOutOfBoundsException
>>>>
>>>> Any idea why this happens, I don't see any problems with these pages !!
>>>>
>>>> Thanks ,
>>>> Hesham
>>>>
>>>>
>>>
> 

Re: Error reading a PDF

Posted by Daniel Wilson <wi...@gmail.com>.
Do you have the full stack trace?  The exception itself isn't telling me
that much.

On Wed, Aug 12, 2009 at 9:52 AM, Hesham G. <he...@gmail.com> wrote:

> Thanks Daniel ,
>
> I'll try the latest version now. But can you tell me why this Exception
> occurred in PDFBox so I can know what I'm looking for ?
>
> Thanks ,
> Hesham
>
> --------------------------------------------------
> From: "Daniel Wilson" <wi...@gmail.com>
> Date: Wednesday, August 12, 2009 4:37 PM
> To: <pd...@incubator.apache.org>
> Subject: Re: Error reading a PDF
>
>
>  Are you using the trunk version (compiling from latest code) or an older
>> version?  If older, please try the latest.
>>
>> Thanks.
>> Daniel
>>
>> 2009/8/12 Hesham G. <he...@gmail.com>
>>
>>   Hi there ,
>>>
>>> I'm trying to read the attached PDF using PDFTextStripper.
>>> The 1st page is read fine, but reading page(2) or (3) causes this
>>> Exception
>>> :
>>>   An exception occurred: java.lang.ArrayIndexOutOfBoundsException
>>>
>>> Any idea why this happens, I don't see any problems with these pages !!
>>>
>>> Thanks ,
>>> Hesham
>>>
>>>
>>

Re: Error reading a PDF

Posted by "Hesham G." <he...@gmail.com>.
Thanks Daniel ,

I'll try the latest version now. But can you tell me why this Exception 
occurred in PDFBox so I can know what I'm looking for ?

Thanks ,
Hesham

--------------------------------------------------
From: "Daniel Wilson" <wi...@gmail.com>
Date: Wednesday, August 12, 2009 4:37 PM
To: <pd...@incubator.apache.org>
Subject: Re: Error reading a PDF

> Are you using the trunk version (compiling from latest code) or an older
> version?  If older, please try the latest.
>
> Thanks.
> Daniel
>
> 2009/8/12 Hesham G. <he...@gmail.com>
>
>>  Hi there ,
>>
>> I'm trying to read the attached PDF using PDFTextStripper.
>> The 1st page is read fine, but reading page(2) or (3) causes this 
>> Exception
>> :
>>    An exception occurred: java.lang.ArrayIndexOutOfBoundsException
>>
>> Any idea why this happens, I don't see any problems with these pages !!
>>
>> Thanks ,
>> Hesham
>>
> 

Re: Error reading a PDF

Posted by Daniel Wilson <wi...@gmail.com>.
Are you using the trunk version (compiling from latest code) or an older
version?  If older, please try the latest.

Thanks.
Daniel

2009/8/12 Hesham G. <he...@gmail.com>

>  Hi there ,
>
> I'm trying to read the attached PDF using PDFTextStripper.
> The 1st page is read fine, but reading page(2) or (3) causes this Exception
> :
>    An exception occurred: java.lang.ArrayIndexOutOfBoundsException
>
> Any idea why this happens, I don't see any problems with these pages !!
>
> Thanks ,
> Hesham
>