You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Slavomir Varchula (JIRA)" <ji...@apache.org> on 2010/08/06 00:23:16 UTC

[jira] Created: (PDFBOX-789) Error by text extraction

Error by text extraction
------------------------

                 Key: PDFBOX-789
                 URL: https://issues.apache.org/jira/browse/PDFBOX-789
             Project: PDFBox
          Issue Type: Bug
          Components: Text extraction
    Affects Versions: 1.2.1
         Environment: winndows xp, 
            Reporter: Slavomir Varchula
             Fix For: 1.3.0


Hello,  
I tried to extract text from pdf and extraction ended with error. Here is pdf, source file and stacktrace.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-789) Error by text extraction

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896528#action_12896528 ] 

Jukka Zitting commented on PDFBOX-789:
--------------------------------------

The problem seems to be related to the large COSStream on page 134. I can avoid the issue easily enough with the following patch, but it would be better to find the root cause instead of relying on a workaround like this.

Index: pdfbox/src/main/java/org/apache/pdfbox/cos/COSString.java
===================================================================
--- pdfbox/src/main/java/org/apache/pdfbox/cos/COSString.java	(revision 982911)
+++ pdfbox/src/main/java/org/apache/pdfbox/cos/COSString.java	(working copy)
@@ -191,7 +191,11 @@
             }
             catch( NumberFormatException e )
             {
-                throw new IOException( "Error: Expected hex number, actual='" + hexChars + "'" );
+                retval.append( '?' );
             }
         }
         return retval;


> Error by text extraction
> ------------------------
>
>                 Key: PDFBOX-789
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-789
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Text extraction
>    Affects Versions: 1.2.1
>         Environment: winndows xp, 
>            Reporter: Slavomir Varchula
>             Fix For: 1.3.0
>
>         Attachments: pdf_euba.pdf, Skuska.java
>
>
> Hello,  
> I tried to extract text from pdf and extraction ended with error. Here is pdf, source file and stacktrace.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-789) Error by text extraction

Posted by "Slavomir Varchula (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896610#action_12896610 ] 

Slavomir Varchula commented on PDFBOX-789:
------------------------------------------

Hello, 
thank you for quick response. It is too heavy from me, where is problem. I use primary Apache Tika(great library) and I have seen, that problem was in PDFBox.   Then I tried to debug, but I have lost in source code. :( The new information is for me, that problem is on page 134. Can I give you  some help ? Or could you recommend what I should look for? 

Best regards.   

> Error by text extraction
> ------------------------
>
>                 Key: PDFBOX-789
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-789
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Text extraction
>    Affects Versions: 1.2.1
>         Environment: winndows xp, 
>            Reporter: Slavomir Varchula
>             Fix For: 1.3.0
>
>         Attachments: pdf_euba.pdf, Skuska.java
>
>
> Hello,  
> I tried to extract text from pdf and extraction ended with error. Here is pdf, source file and stacktrace.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-789) Error by text extraction

Posted by "Slavomir Varchula (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Slavomir Varchula updated PDFBOX-789:
-------------------------------------

    Attachment: Skuska.java
                pdf_euba.pdf

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Error: Expected hex number, actual='2<'
	at org.apache.pdfbox.pdfparser.PDFStreamParser$1.tryNext(PDFStreamParser.java:148)
	at org.apache.pdfbox.pdfparser.PDFStreamParser$1.hasNext(PDFStreamParser.java:157)
	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:241)
	at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:208)
	at org.apache.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:378)
	at org.apache.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:302)
	at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:258)
	at org.apache.pdfbox.util.PDFTextStripper.getText(PDFTextStripper.java:184)
	at Skuska.main(Skuska.java:11)
Caused by: java.io.IOException: Error: Expected hex number, actual='2<'
	at org.apache.pdfbox.cos.COSString.createFromHexString(COSString.java:194)
	at org.apache.pdfbox.pdfparser.BaseParser.parseCOSString(BaseParser.java:713)
	at org.apache.pdfbox.pdfparser.PDFStreamParser.parseNextToken(PDFStreamParser.java:226)
	at org.apache.pdfbox.pdfparser.PDFStreamParser.access$000(PDFStreamParser.java:46)
	at org.apache.pdfbox.pdfparser.PDFStreamParser$1.tryNext(PDFStreamParser.java:145)
	... 8 more


> Error by text extraction
> ------------------------
>
>                 Key: PDFBOX-789
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-789
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Text extraction
>    Affects Versions: 1.2.1
>         Environment: winndows xp, 
>            Reporter: Slavomir Varchula
>             Fix For: 1.3.0
>
>         Attachments: pdf_euba.pdf, Skuska.java
>
>
> Hello,  
> I tried to extract text from pdf and extraction ended with error. Here is pdf, source file and stacktrace.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PDFBOX-789) Error by text extraction

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved PDFBOX-789.
----------------------------------

    Resolution: Fixed
      Assignee: Jukka Zitting

I fixed this more properly in revision 1022431 by making the forceParsing option apply also here. See the -force option of the ExtractText command for an example of how this works.

> Error by text extraction
> ------------------------
>
>                 Key: PDFBOX-789
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-789
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Text extraction
>    Affects Versions: 1.2.1
>         Environment: winndows xp, 
>            Reporter: Slavomir Varchula
>            Assignee: Jukka Zitting
>             Fix For: 1.3.0
>
>         Attachments: pdf_euba.pdf, Skuska.java
>
>
> Hello,  
> I tried to extract text from pdf and extraction ended with error. Here is pdf, source file and stacktrace.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.