xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sstei...@apache.org
Subject svn commit: r1753394 - in /xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop: pdf/PDFEmbeddedFile.java pdf/PDFRoot.java render/pdf/PDFRenderingUtil.java
Date Tue, 19 Jul 2016 14:03:02 GMT
Author: ssteiner
Date: Tue Jul 19 14:03:02 2016
New Revision: 1753394

URL: http://svn.apache.org/viewvc?rev=1753394&view=rev
Log:
FOP-2625: Allow Attachments for PDF/A-3

Modified:
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java

Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java?rev=1753394&r1=1753393&r2=1753394&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java (original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java Tue
Jul 19 14:03:02 2016
@@ -33,8 +33,10 @@ public class PDFEmbeddedFile extends PDF
     public PDFEmbeddedFile() {
         super();
         put("Type", new PDFName("EmbeddedFile"));
+        put("Subtype", new PDFName("application/octet-stream"));
         PDFDictionary params = new PDFDictionary();
         params.put("CreationDate", PDFInfo.formatDateTime(new Date()));
+        params.put("ModDate", PDFInfo.formatDateTime(new Date()));
         put("Params", params);
     }
 

Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java?rev=1753394&r1=1753393&r2=1753394&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java (original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java Tue Jul 19
14:03:02 2016
@@ -53,7 +53,7 @@ public class PDFRoot extends PDFDictiona
     private final PDFDocument document;
 
     private PDFDPartRoot dPartRoot;
-
+    private PDFArray af;
 
     private static final PDFName[] PAGEMODE_NAMES = new PDFName[] {
         new PDFName("UseNone"),
@@ -333,4 +333,14 @@ public class PDFRoot extends PDFDictiona
         }
         return dPartRoot;
     }
+
+    public void addAF(PDFFileSpec fileSpec, String filename) {
+        if (af == null) {
+            af = new PDFArray();
+            put("AF", af);
+        }
+        af.add(fileSpec);
+        fileSpec.put("UF", filename);
+        fileSpec.put("AFRelationship", new PDFName("Data"));
+    }
 }

Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java?rev=1753394&r1=1753393&r2=1753394&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
(original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
Tue Jul 19 14:03:02 2016
@@ -679,6 +679,7 @@ class PDFRenderingUtil {
         dict.put("F", file);
         String filename = PDFText.toPDFString(embeddedFile.getFilename(), '_');
         PDFFileSpec fileSpec = new PDFFileSpec(filename);
+        pdfDoc.getRoot().addAF(fileSpec, filename);
         fileSpec.setEmbeddedFile(dict);
         if (embeddedFile.getDesc() != null) {
             fileSpec.setDescription(embeddedFile.getDesc());



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message