Package org.apache.fop.render.pdf
Class PDFRenderingUtil
- java.lang.Object
-
- org.apache.fop.render.pdf.PDFRenderingUtil
-
class PDFRenderingUtil extends java.lang.ObjectUtility class which enables all sorts of features that are not directly connected to the normal rendering process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPDFRenderingUtil.EncryptionParamsBuilder
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.commons.logging.Logloglogging instanceprivate PDFICCStreamoutputProfilethe ICC stream used as output profile by this document for PDF/A and PDF/X functionality.private PDFDocumentpdfDocthe PDF Document being createdprivate PDFRendererOptionsConfigrendererConfigprivate PDFICCBasedColorSpacesRGBColorSpacethe default sRGB color space.private FOUserAgentuserAgent
-
Constructor Summary
Constructors Constructor Description PDFRenderingUtil(FOUserAgent userAgent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddDefaultOutputProfile()voidaddEmbeddedFile(PDFEmbeddedFileAttachment embeddedFile)Adds an embedded file to the PDF file.voidaddLayer(PDFDictionaryExtension extension)voidaddNavigator(PDFDictionaryExtension extension)voidaddNavigatorAction(PDFDictionaryExtension extension)private voidaddPDFA1OutputIntent()Adds an OutputIntent to the PDF as mandated by PDF/A-1 when uncalibrated color spaces are used (which is true if we use DeviceRGB to represent sRGB colors).private voidaddPDFXOutputIntent()Adds an OutputIntent to the PDF as mandated by PDF/X when uncalibrated color spaces are used (which is true if we use DeviceRGB to represent sRGB colors).private voidaddsRGBColorSpace()private PDFArrayaugmentArray(PDFArray array, PDFArrayExtension extension)private voidaugmentArray(PDFArray array, PDFCollectionEntryExtension entry)private voidaugmentDictionary(PDFDictionary dictionary, PDFCollectionEntryExtension entry)private PDFDictionaryaugmentDictionary(PDFDictionary dictionary, PDFDictionaryExtension extension)protected static PDFRendererOptionsConfigcreateFromUserAgent(FOUserAgent userAgent)voidgenerateDefaultXMPMetadata()voidgeneratePageLabel(int pageIndex, java.lang.String pageNumber)Generates a page label in the PDF document.private booleanhasKeyedEntry(java.util.List<?> entries)private voidinitialize()private java.lang.ObjectmakeArray(java.lang.Object value)private java.lang.ObjectmakeDictionary(java.lang.Object value)private java.lang.ObjectmakeDictionaryOrArray(java.lang.Object value)(package private) voidmergeRendererOptionsConfig(PDFRendererOptionsConfig config)private java.lang.ObjectpopulateArray(PDFArray array, java.util.List<?> entries)private java.lang.ObjectpopulateDictionary(PDFDictionary dictionary, java.util.List<?> entries)voidrenderDictionaryExtension(PDFDictionaryAttachment attachment, PDFPage currentPage)voidrenderDictionaryExtension(PDFDictionaryExtension extension, PDFPage currentPage)voidrenderXMPMetadata(XMPMetadata metadata)private java.lang.ObjectresolveReference(PDFReferenceExtension entry)PDFDocumentsetupPDFDocument(java.io.OutputStream out)private voidupdateInfo()private voidupdatePDFProfiles()
-
-
-
Field Detail
-
log
private static org.apache.commons.logging.Log log
logging instance
-
userAgent
private FOUserAgent userAgent
-
pdfDoc
private PDFDocument pdfDoc
the PDF Document being created
-
rendererConfig
private PDFRendererOptionsConfig rendererConfig
-
outputProfile
private PDFICCStream outputProfile
the ICC stream used as output profile by this document for PDF/A and PDF/X functionality.
-
sRGBColorSpace
private PDFICCBasedColorSpace sRGBColorSpace
the default sRGB color space.
-
-
Constructor Detail
-
PDFRenderingUtil
PDFRenderingUtil(FOUserAgent userAgent)
-
-
Method Detail
-
initialize
private void initialize()
-
createFromUserAgent
protected static PDFRendererOptionsConfig createFromUserAgent(FOUserAgent userAgent)
-
mergeRendererOptionsConfig
void mergeRendererOptionsConfig(PDFRendererOptionsConfig config)
-
updateInfo
private void updateInfo()
-
updatePDFProfiles
private void updatePDFProfiles()
-
addsRGBColorSpace
private void addsRGBColorSpace() throws java.io.IOException- Throws:
java.io.IOException
-
addDefaultOutputProfile
private void addDefaultOutputProfile() throws java.io.IOException- Throws:
java.io.IOException
-
addPDFA1OutputIntent
private void addPDFA1OutputIntent() throws java.io.IOExceptionAdds an OutputIntent to the PDF as mandated by PDF/A-1 when uncalibrated color spaces are used (which is true if we use DeviceRGB to represent sRGB colors).- Throws:
java.io.IOException- in case of an I/O problem
-
addPDFXOutputIntent
private void addPDFXOutputIntent() throws java.io.IOExceptionAdds an OutputIntent to the PDF as mandated by PDF/X when uncalibrated color spaces are used (which is true if we use DeviceRGB to represent sRGB colors).- Throws:
java.io.IOException- in case of an I/O problem
-
renderXMPMetadata
public void renderXMPMetadata(XMPMetadata metadata)
-
generateDefaultXMPMetadata
public void generateDefaultXMPMetadata()
-
renderDictionaryExtension
public void renderDictionaryExtension(PDFDictionaryAttachment attachment, PDFPage currentPage)
-
addLayer
public void addLayer(PDFDictionaryExtension extension)
-
addNavigatorAction
public void addNavigatorAction(PDFDictionaryExtension extension)
-
addNavigator
public void addNavigator(PDFDictionaryExtension extension)
-
makeArray
private java.lang.Object makeArray(java.lang.Object value)
-
populateArray
private java.lang.Object populateArray(PDFArray array, java.util.List<?> entries)
-
makeDictionary
private java.lang.Object makeDictionary(java.lang.Object value)
-
populateDictionary
private java.lang.Object populateDictionary(PDFDictionary dictionary, java.util.List<?> entries)
-
makeDictionaryOrArray
private java.lang.Object makeDictionaryOrArray(java.lang.Object value)
-
hasKeyedEntry
private boolean hasKeyedEntry(java.util.List<?> entries)
-
renderDictionaryExtension
public void renderDictionaryExtension(PDFDictionaryExtension extension, PDFPage currentPage)
-
augmentDictionary
private PDFDictionary augmentDictionary(PDFDictionary dictionary, PDFDictionaryExtension extension)
-
augmentDictionary
private void augmentDictionary(PDFDictionary dictionary, PDFCollectionEntryExtension entry)
-
resolveReference
private java.lang.Object resolveReference(PDFReferenceExtension entry)
-
augmentArray
private PDFArray augmentArray(PDFArray array, PDFArrayExtension extension)
-
augmentArray
private void augmentArray(PDFArray array, PDFCollectionEntryExtension entry)
-
setupPDFDocument
public PDFDocument setupPDFDocument(java.io.OutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
generatePageLabel
public void generatePageLabel(int pageIndex, java.lang.String pageNumber)Generates a page label in the PDF document.- Parameters:
pageIndex- the index of the pagepageNumber- the formatted page number
-
addEmbeddedFile
public void addEmbeddedFile(PDFEmbeddedFileAttachment embeddedFile) throws java.io.IOException
Adds an embedded file to the PDF file.- Parameters:
embeddedFile- the object representing the embedded file to be added- Throws:
java.io.IOException- if an I/O error occurs
-
-