pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Nibali <rnib...@gmail.com>
Subject NPE through NFE in preflight due to "questionable" header entry
Date Wed, 27 Jan 2016 14:08:35 GMT
Hi

The PDF uploaded to http://www.filedropper.com/6biasebm seems to have a
broken header section. It opens well with Preview, Adobe and others,
however preflight repeatedly trips pretty badly with a NFE:

log4j: Adding appender named [console] to category [root].
2016-01-27 14:52:38 DEBUG COSParser:1879 - Can't parse the header version.
java.lang.NumberFormatException: For input string: "1.\"
        at
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
        at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
        at java.lang.Float.parseFloat(Float.java:451)
        at
org.apache.pdfbox.pdfparser.COSParser.parseHeader(COSParser.java:1874)
        at
org.apache.pdfbox.pdfparser.COSParser.parsePDFHeader(COSParser.java:1801)
        at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:242)
        at
org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:208)
        at
org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:190)
        at
org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:178)
        at
org.apache.pdfbox.preflight.parser.XmlResultParser.validate(XmlResultParser.java:70)
        at
org.apache.pdfbox.preflight.parser.XmlResultParser.validate(XmlResultParser.java:51)
        at
org.apache.pdfbox.preflight.Validator_A1b.main(Validator_A1b.java:121)
2016-01-27 14:52:38 DEBUG COSParser:1879 - Can't parse the header version.
java.lang.NumberFormatException: For input string: "1.\"
        at
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
        at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
        at java.lang.Float.parseFloat(Float.java:451)
        at
org.apache.pdfbox.pdfparser.COSParser.parseHeader(COSParser.java:1874)
        at
org.apache.pdfbox.pdfparser.COSParser.parsePDFHeader(COSParser.java:1801)
        at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:242)
        at
org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:208)
        at
org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:190)
        at
org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:178)
        at
org.apache.pdfbox.preflight.parser.XmlResultParser.validate(XmlResultParser.java:70)
        at
org.apache.pdfbox.preflight.parser.XmlResultParser.validate(XmlResultParser.java:51)
        at
org.apache.pdfbox.preflight.Validator_A1b.main(Validator_A1b.java:121)
2016-01-27 14:52:38 DEBUG COSParser:1879 - Can't parse the header version.
java.lang.NumberFormatException: For input string: "1.\"
        at
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
        at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
        at java.lang.Float.parseFloat(Float.java:451)
        at
org.apache.pdfbox.pdfparser.COSParser.parseHeader(COSParser.java:1874)
        at
org.apache.pdfbox.pdfparser.COSParser.parsePDFHeader(COSParser.java:1801)
        at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:242)
        at
org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:208)
        at
org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:190)
        at
org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:178)
        at
org.apache.pdfbox.preflight.parser.XmlResultParser.validate(XmlResultParser.java:70)
        at
org.apache.pdfbox.preflight.parser.XmlResultParser.validate(XmlResultParser.java:51)
        at
org.apache.pdfbox.preflight.Validator_A1b.main(Validator_A1b.java:121)
[...]

Notwithstanding the issue at hand with the header mismatch, I believe we
should not throw a repetitive NFE here.

Further down the road the festival results in an abundance of the following:

2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
2016-01-27 14:52:41 DEBUG ScratchFileBuffer:516 - ScratchFileBuffer not
closed!
[...]

Code used: SVN head of today. Should the header parsing be relaxed to match
Adobe's interpretation?

Adobe's Preflight gives me pointers with regard to the following traversal
path:

[image: Inline image 1]

PDFBox's preflight returns the following XML report:

[image: Inline image 2]

Cheers

Roberto

Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message