git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@757712 13f79535-47bb-0310-9956-ffa450edef68tags/fop-1_0
@@ -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; | |||
} | |||
} |
@@ -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; | |||
} | |||
/** |
@@ -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(); | |||
} | |||
} |
@@ -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; | |||
} | |||
/** |