[ 
https://issues.apache.org/jira/browse/PDFBOX-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358126#comment-16358126
 ] 

lwf commented on PDFBOX-4102:
-----------------------------

Hi [~tilman], how do I make sure the file is transferred in binary mode? Also, 
how do I make sure the filtering is off, and perform MD5 checksum? Sorry for 
these enquires as I am new to the library. The following are my current codes:



 PDDocument {color:#6a3e3e}document{color} = PDDocument._load_(new 
File({color:#6a3e3e}filename){color});

 PDFTextStripper {color:#6a3e3e}tStripper{color} = *{color:#7f0055}new{color}* 
PDFTextStripper();

{color:#6a3e3e}tStripper{color}.setSortByPosition(*{color:#7f0055}true{color}*);

 String {color:#6a3e3e}pdfFileInText{color} = 
{color:#6a3e3e}tStripper{color}.getText({color:#6a3e3e}document{color}); 
//error seems to occur at this line

 

Thanks a lot for your help.

> java.lang.IllegalArgumentException: root cannot be null
> -------------------------------------------------------
>
>                 Key: PDFBOX-4102
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4102
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.8
>            Reporter: lwf
>            Priority: Major
>         Attachments: Testing 123.pdf
>
>
> {color:#f00000}java.lang.IllegalArgumentException: root cannot be null{color}
>  at org.apache.pdfbox.pdmodel.PDPageTree.<init>(PDPageTree.java:75)
>  at 
> org.apache.pdfbox.pdmodel.PDDocumentCatalog.getPages(PDDocumentCatalog.java:129)
>  at org.apache.pdfbox.pdmodel.PDDocument.getPages(PDDocument.java:1401)
>  at org.apache.pdfbox.text.PDFTextStripper.writeText(PDFTextStripper.java:266)
>  at org.apache.pdfbox.text.PDFTextStripper.getText(PDFTextStripper.java:227)
>  
>  
> Due to confidentiality of the original document, I'm uploaded a test document 
> which results in the same error. I'm using pdfbox-app-2.0.8.jar... please 
> help asap :(



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to