pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilman Hausherr (Jira)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4443) Error: End-of-File, expected line
Date Sat, 24 Aug 2019 04:00:17 GMT

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

Tilman Hausherr commented on PDFBOX-4443:
-----------------------------------------

Because you try so many URLs, I assume you're running some sort of file collection tool. It
could be that URLs are temporarily not available, or URLs broken without the server delivering
a proper HTTP error message. Or, as in the URL that didn't work 2 days ago, not being a PDF
at all.

My suggestion is that you'd first download into a file, check that file whether it starts
with "%PDF", and only then let PDFBox on it. This way you can separate download problems from
PDF problems.

> Error: End-of-File, expected line
> ---------------------------------
>
>                 Key: PDFBOX-4443
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4443
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.13
>         Environment: Linux
>            Reporter: Dinesh
>            Priority: Critical
>              Labels: linux
>
> I am using the latest version of pdfbox.
> I am able to extraxt the file as normal stream in java 8 and open as pdf.
> But when try to load with pdfbox getting below error
> Getting this exception when filename is passed from shell script in linux.
> java.io.IOException: Error: End-of-File, expected line
>  at org.apache.pdfbox.pdfparser.BaseParser.readLine(BaseParser.java:1121) ~[pdfbox-2.0.13.jar:2.0.13]
>  at org.apache.pdfbox.pdfparser.COSParser.parseHeader(COSParser.java:2574) ~[pdfbox-2.0.13.jar:2.0.13]
>  at org.apache.pdfbox.pdfparser.COSParser.parsePDFHeader(COSParser.java:2553) ~[pdfbox-2.0.13.jar:2.0.13]
>  at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:219) ~[pdfbox-2.0.13.jar:2.0.13]
>  at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1200) ~[pdfbox-2.0.13.jar:2.0.13]
>  at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1173) ~[pdfbox-2.0.13.jar:2.0.13]



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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


Mime
View raw message