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 COFFMAN Steven <SC...@CBSINC.com> on 2000/06/21 23:09:41 UTC

RE: [PATCH] Output binary comment to make sure PDF is treated as bina ry

Does your binary comment mean anything? Like a hidden message? :)
-Steve

-----Original Message-----
From: Timm, Sean [mailto:STimm@mailgo.com]
Sent: Wednesday, June 21, 2000 5:03 PM
To: 'fop-dev@xml.apache.org'
Subject: [PATCH] Output binary comment to make sure PDF is treated as
bina ry


Well, per Steve's suggestion, I modified FOP to output a binary comment to
ensure that the file was treated as binary.  Unfortunately, this didn't help
any, and I'm still receiving all blank pages in my fax.  Anyway, here's the
patch:

Index: PDFDocument.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/pdf/PDFDocument.java,v
retrieving revision 1.12
diff -u -r1.12 PDFDocument.java
--- PDFDocument.java	2000/06/21 01:40:56	1.12
+++ PDFDocument.java	2000/06/21 20:59:43
@@ -891,6 +891,11 @@
            the header's length */
         this.position += outputHeader(writer);
 
+        /* Ensure that the PDF is treated as a binary file */
+        String binaryComment = "%\u00E2\u00E3\u00CF\u00D3\r\n";
+        writer.write(binaryComment);
+        this.position += binaryComment.length();
+
         this.resources.setXObjects(xObjects);
 
         /* loop through the object numbers */