You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2006/03/23 03:09:50 UTC

DO NOT REPLY [Bug 39070] New: - FOP Produced PDFs contain invalid Info Dict entry

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: jyonosh@fcg.com


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.

DO NOT REPLY [Bug 39070] - FOP Produced PDFs contain invalid Info Dict entry

Posted by bu...@apache.org.
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


jeremias@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From jeremias@apache.org  2006-03-23 07:59 -------
Bug fixed in FOP Trunk: http://svn.apache.org/viewcvs?rev=388092&view=rev
Thank you, John! You are right, of course. Surprising this bug went undetected
for so long.

-- 
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.