aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/pdf/AbstractPDFFontStream.java5
-rw-r--r--src/java/org/apache/fop/pdf/AbstractPDFStream.java20
-rw-r--r--src/java/org/apache/fop/pdf/PDFImageXObject.java9
-rw-r--r--src/java/org/apache/fop/pdf/PDFMetadata.java5
4 files changed, 18 insertions, 21 deletions
diff --git a/src/java/org/apache/fop/pdf/AbstractPDFFontStream.java b/src/java/org/apache/fop/pdf/AbstractPDFFontStream.java
index f3d005bd3..34c9c5dee 100644
--- a/src/java/org/apache/fop/pdf/AbstractPDFFontStream.java
+++ b/src/java/org/apache/fop/pdf/AbstractPDFFontStream.java
@@ -33,9 +33,8 @@ public abstract class AbstractPDFFontStream extends AbstractPDFStream {
}
/** {@inheritDoc} */
- protected void setupFilterList() {
- addDefaultFilter(PDFFilterList.FONT_FILTER);
- super.setupFilterList();
+ protected String getDefaultFilterName() {
+ return PDFFilterList.FONT_FILTER;
}
}
diff --git a/src/java/org/apache/fop/pdf/AbstractPDFStream.java b/src/java/org/apache/fop/pdf/AbstractPDFStream.java
index fc853b512..4107c7e7a 100644
--- a/src/java/org/apache/fop/pdf/AbstractPDFStream.java
+++ b/src/java/org/apache/fop/pdf/AbstractPDFStream.java
@@ -47,21 +47,23 @@ public abstract class AbstractPDFStream extends PDFDictionary {
* from outside.
*/
protected void setupFilterList() {
- addDefaultFilter(PDFFilterList.DEFAULT_FILTER);
+ if (!getFilterList().isInitialized()) {
+ getFilterList().addDefaultFilters(
+ getDocumentSafely().getFilterMap(),
+ getDefaultFilterName());
+ }
prepareImplicitFilters();
getDocument().applyEncryption(this);
}
/**
- * Adds the default filter to the filter list if the filter list hasn't been initialized, yet.
- * @param filterName the name of the default filter to use
+ * Returns the name of a suitable filter for this PDF object.
+ *
+ * @return the default filter
+ * @see PDFFilterList
*/
- protected void addDefaultFilter(String filterName) {
- if (!getFilterList().isInitialized()) {
- getFilterList().addDefaultFilters(
- getDocumentSafely().getFilterMap(),
- filterName);
- }
+ protected String getDefaultFilterName() {
+ return PDFFilterList.DEFAULT_FILTER;
}
/**
diff --git a/src/java/org/apache/fop/pdf/PDFImageXObject.java b/src/java/org/apache/fop/pdf/PDFImageXObject.java
index a69d9e8de..9ec8f1595 100644
--- a/src/java/org/apache/fop/pdf/PDFImageXObject.java
+++ b/src/java/org/apache/fop/pdf/PDFImageXObject.java
@@ -159,14 +159,11 @@ public class PDFImageXObject extends PDFXObject {
}
/**
- * This sets up the default filters for XObjects. It uses the PDFImage
- * instance to determine what default filters to apply.
* {@inheritDoc}
+ * This class uses the PDFImage instance to determine the default filter.
*/
- protected void setupFilterList() {
- addDefaultFilter(pdfimage.getFilterHint());
- super.setupFilterList();
+ protected String getDefaultFilterName() {
+ return pdfimage.getFilterHint();
}
-
}
diff --git a/src/java/org/apache/fop/pdf/PDFMetadata.java b/src/java/org/apache/fop/pdf/PDFMetadata.java
index 5008183ef..92796c0d1 100644
--- a/src/java/org/apache/fop/pdf/PDFMetadata.java
+++ b/src/java/org/apache/fop/pdf/PDFMetadata.java
@@ -59,9 +59,8 @@ public class PDFMetadata extends PDFStream {
}
/** {@inheritDoc} */
- protected void setupFilterList() {
- addDefaultFilter(PDFFilterList.METADATA_FILTER);
- super.setupFilterList();
+ protected String getDefaultFilterName() {
+ return PDFFilterList.METADATA_FILTER;
}
/**