Bug 51270 - [PATCH] PDFOutline: 'endobj' should be preceded by an EOL
Summary: [PATCH] PDFOutline: 'endobj' should be preceded by an EOL
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: all
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
: 51301 (view as bug list)
Depends on:
Reported: 2011-05-26 13:09 UTC by Matthias Bauer
Modified: 2012-04-08 20:36 UTC (History)
1 user (show)

patch (483 bytes, application/octet-stream)
2011-05-26 13:09 UTC, Matthias Bauer

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Bauer 2011-05-26 13:09:46 UTC
Created attachment 27071 [details]

org.apache.fop.pdf.PDFOutline.toPDF() outputs ">> endobj\n". 

According to PDF/A spec (or at least according to the validators I've used) there has to be a "\n" in front of the endobj tag. (And at every other position in the code we're already outputting a "\n".)

The patch changes the output to ">>\nendobj\n".
Comment 1 Andreas L. Delmelle 2011-05-31 18:08:08 UTC
*** Bug 51301 has been marked as a duplicate of this bug. ***
Comment 2 Oliver Moehrke 2011-05-31 18:29:08 UTC
I applied the patch to the v1.0 source-tree and it solves the compatibility issue with Intarsys PDF/A Live! validator.

Thank you.
Comment 3 Andreas L. Delmelle 2011-05-31 18:34:59 UTC
Thanks for reporting, and the patch!
I currently have some conflicting changes to the same classes to work out, and I'll gladly incorporate this one. 
However, instead of fixing this in one spot --the only place where it happens to be wrong-- I will, at the same time, look at the other 12 occurrences of ">>\nendobj\n" and extract those into a single method of PDFObject. At least, that will prevent it from ever reoccurring (assuming that all good devs will copy the existing pattern, that is)
Comment 4 Glenn Adams 2012-04-07 01:42:53 UTC
resetting P2 open bugs to P3 pending further review
Comment 5 Glenn Adams 2012-04-08 09:10:58 UTC
increase priority due to presence of a patch
Comment 6 Glenn Adams 2012-04-08 20:36:27 UTC
the proposed change was commit on 2012-03-21 in r1303431