DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39070>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39070

           Summary: FOP Produced PDFs contain invalid Info Dict entry
           Product: Fop
           Version: all
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: pdf
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: [EMAIL PROTECTED]


Adding "/Type /Info" as an info dictionary entry produces an entry in the info
dict whose value is a name(pdf data type). This is invalid (as names are not
allows as values within the info dict), and causes some PDF Libraries the throw
errors when reading the information. 

In my case i have an application using the Adobe PDF Library 7.0 that throws an
error("Could not create internal representation of XMP metadata") when calling
PDDocGetXAPMetadataProperty. When i remove the invalid entry from the info dict,
everything works properly.

I did look in the svn repository and it appears that the Trunk code should still
have the same issue.

The following is what i updated in 0.20.5 to work around the issue

>From org.apache.fop.pdf.PDFInfo

    public byte[] toPDF() {
        String p = this.number + " " + this.generation
                   + " obj\n<< /Type /Info\n/Producer (" + this.producer
                   + ") >>\nendobj\n";
        try {
            return p.getBytes(PDFDocument.ENCODING);
        } catch (UnsupportedEncodingException ue) {
            return p.getBytes();
        }       
    }

should be changed to(just removing the "/Type /Info")
    public byte[] toPDF() {
        String p = this.number + " " + this.generation
                   + " obj\n<< \n/Producer (" + this.producer
                   + ") >>\nendobj\n";
        try {
            return p.getBytes(PDFDocument.ENCODING);
        } catch (UnsupportedEncodingException ue) {
            return p.getBytes();
        }       
    }

Thanks,
john

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to