[
https://issues.apache.org/jira/browse/PDFBOX-3639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16094824#comment-16094824
]
Tilman Hausherr edited comment on PDFBOX-3639 at 7/20/17 3:34 PM:
------------------------------------------------------------------
Thank you for the research, the issue is indeed in
{{COSParser.rebuildTrailer()}}. I looked at the PDF specification and your file
is fine. An FDF file does not need a catalog entry. It needs an FDF entry. I
have changed that accordingly. I'll also use your two small files as
inspiration for tests that I'll add at a later time.
Re the last commit: the better way would be to have extenders of COSParser to
implement {{isCatalog()}} but this would break existing applications that have
their own extension of COSParser. So the default is the current behavior and
only the FDF parser must override the method.
was (Author: tilman):
Thank you for the research, the issue is indeed in
{{COSParser.rebuildTrailer()}}. I looked at the PDF specification and your file
is fine. An FDF file does not need a catalog entry. It needs an FDF entry. I
have changed that accordingly. I'll also use your two small files as
inspiration for tests that I'll add at a later time.
> FDF does not parse: Missing root object specification in trailer.
> -----------------------------------------------------------------
>
> Key: PDFBOX-3639
> URL: https://issues.apache.org/jira/browse/PDFBOX-3639
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 2.0.6
> Environment: jdk1.8.0_111
> Reporter: Joe Masinter
> Assignee: Tilman Hausherr
> Priority: Minor
> Fix For: 2.0.8, 3.0.0
>
>
> FDF file generated with IText does not parse with PDFBox FDFParser
> FDFParser parser = new FDFParser(new FileInputStream("D:/dev/failsfdf.fdf"));
> parser.parse();
> java.io.IOException: Missing root object specification in trailer.
> at
> org.apache.pdfbox.pdfparser.COSParser.parseTrailerValuesDynamically(COSParser.java:2121)
> Content of FDF file:
> {code}
> %FDF-1.4
> %âãÏÓ
> 1 0 obj
> <</FDF<</Fields[<</T(ELD Goal2)/V()>><</T(ELD Goal3)/V()>><</T(ELD
> Goal1)/V()>><</Kids[<</T(modifications:3)/V()>><</T(level)/V(Early
> Advanced)>><</T(variations:1)/V(Test in small
> group)>><</T(accommodations:3)/V(Test over more than one
> day)>><</T(variations:3)/V()>><</T(variations:2)/V()>><</T(accommodations:1)/V(Administer
> at time most beneficial to student)>><</T(accommodations:2)/V(Supervised
> breaks within a section of the
> test)>><</T(modifications:2)/V()>><</T(modifications:1)/V()>>]/T(EL_Listening)>><</T(Alt
> Ed Levels)/V( )>><</Kids[<</T(modifications:3)/V()>><</T(level)/V(Early
> Advanced)>><</T(variations:1)/V(Test in small
> group)>><</T(accommodations:3)/V(Test over more than one
> day)>><</T(variations:3)/V()>><</T(variations:2)/V()>><</T(accommodations:1)/V(Administer
> at time most beneficial to student)>><</T(accommodations:2)/V(Supervised
> breaks within a section of the
> test)>><</T(modifications:2)/V()>><</T(modifications:1)/V()>>]/T(EL_Speaking)>><</T(ELD
> Location)/V(General education class)>><</T(Meeting
> Date)/V(9/10/2013)>><</T(ELD Services)/V/SEI>><</T(ELD Strategies4)/V(
> )>><</T(ELD
> Strategies2)/V(Think/pair/share)>><</T(_NATIV_LANG1)/V(Spanish)>><</T(ELD
> Strategies3)/V(Modeling & visualizing)>><</T(ELD Frequency)/V(day)>><</T(ELD
> Strategies1)/V(Graphic organizers or study
> guides)>><</T(BIRTHDATE)/V(8/30/2001)>><</T(_NATIV_LANG2)/V(Spanish)>><</Kids[<</T(modifications:3)/V()>><</T(level)/V(Beginning)>><</T(variations:1)/V(Test
> in small group)>><</T(variations:3)/V()>><</T(accommodations:3)/V(Test over
> more than one
> day)>><</T(variations:2)/V()>><</T(accommodations:1)/V(Administer at time
> most beneficial to student)>><</T(accommodations:2)/V(Supervised breaks
> within a section of the
> test)>><</T(modifications:2)/V()>><</T(modifications:1)/V()>>]/T(EL_Reading)>><</Kids[<</T(modifications:3)/V()>><</T(level)/V(Early
> Intermediate)>><</T(variations:1)/V(Test in small
> group)>><</T(accommodations:3)/V(Test over more than one
> day)>><</T(variations:3)/V()>><</T(variations:2)/V()>><</T(accommodations:1)/V(Administer
> at time most beneficial to student)>><</T(accommodations:2)/V(Supervised
> breaks within a section of the
> test)>><</T(modifications:2)/V()>><</T(modifications:1)/V()>>]/T(EL_Writing)>><</T(SELPA
> Header)/V(LA County Charter)>><</T(NATIV_LANG)/V(Spanish)>><</T(ELD Location
> minutes)/V()>><</T(Assmt Instrument)/V(CELDT)>><</Kids[<</T(level)/V(Early
> Intermediate)>>]/T(EL_Overall)>><</T(EL CELDT Overall Date)/V()>>]>>>>
> endobj
> trailer
> <</Root 1 0 R>>
> %%EOF
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]