aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java2
-rw-r--r--fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java12
-rw-r--r--fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java1
3 files changed, 14 insertions, 1 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java
index ae6893944..035c6cdbc 100644
--- a/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java
+++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java
@@ -33,8 +33,10 @@ public class PDFEmbeddedFile extends PDFStream {
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);
}
diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java
index 32edc34fc..5077ba68b 100644
--- a/fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java
+++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFRoot.java
@@ -53,7 +53,7 @@ public class PDFRoot extends PDFDictionary {
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 PDFDictionary {
}
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"));
+ }
}
diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
index 18a804b5d..e870b3469 100644
--- a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
+++ b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
@@ -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());