Package org.apache.fop.pdf
Class PDFRoot
java.lang.Object
org.apache.fop.pdf.PDFObject
org.apache.fop.pdf.PDFDictionary
org.apache.fop.pdf.PDFRoot
- All Implemented Interfaces:
PDFWritable
Class representing a Root (/Catalog) object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Full screen page modestatic final int
Use no page mode setting, defaultstatic final int
Use outlines page mode to show bookmarksstatic final int
Use thumbs page mode to show thumbnail imagesFields inherited from class org.apache.fop.pdf.PDFDictionary
entries, order
-
Constructor Summary
ConstructorsConstructorDescriptionPDFRoot
(PDFDocument document, PDFPages pages) create a Root (/Catalog) object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAF
(PDFFileSpec fileSpec) void
addOutputIntent
(PDFOutputIntent outputIntent) Adds an OutputIntent to the PDFvoid
add a /Page object to the root /Pages objectReturns the language identifier of the document.Returns the MarkInfo dictionary.Returns the /Metadata objectgetNames()
Returns the /Names object.Returns the /OutputIntents array.Returns the /PageLabels object.int
Returns the currently active /PageMode.Get the root PDF outline for the document.Returns the /PageLabels object.Returns the StructTreeRoot object.void
Marks this document as conforming to the Tagged PDF conventions.int
output
(OutputStream stream) Write the PDF represention of this objectvoid
setLanguage
(Locale locale) Sets the locale of the document.void
setMetadata
(PDFMetadata meta) Set the optional Metadata object.void
Set the /Names object.void
setPageLabels
(PDFPageLabels pageLabels) Sets the /PageLabels object.void
setPageMode
(int mode) Set the page mode for the PDF document.void
setRootOutline
(PDFOutline out) Set the root outline for the PDF document.void
setRootPages
(PDFPages pages) set the root /Pages objectvoid
setStructTreeRoot
(PDFStructTreeRoot structTreeRoot) Sets the StructTreeRoot object.Methods inherited from class org.apache.fop.pdf.PDFDictionary
containsKey, get, getChildren, getChildren, keySet, put, put, remove, writeDictionary
Methods inherited from class org.apache.fop.pdf.PDFObject
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
-
Field Details
-
PAGEMODE_USENONE
public static final int PAGEMODE_USENONEUse no page mode setting, default- See Also:
-
PAGEMODE_USEOUTLINES
public static final int PAGEMODE_USEOUTLINESUse outlines page mode to show bookmarks- See Also:
-
PAGEMODE_USETHUMBS
public static final int PAGEMODE_USETHUMBSUse thumbs page mode to show thumbnail images- See Also:
-
PAGEMODE_FULLSCREEN
public static final int PAGEMODE_FULLSCREENFull screen page mode- See Also:
-
-
Constructor Details
-
PDFRoot
create a Root (/Catalog) object. NOTE: The PDFRoot object must be created before the PDF document is generated, but it is not assigned an object ID until it is about to be written (immediately before the xref table as part of the trailer). (mark-fop@inomial.com)- Parameters:
document
- TODOpages
- the PDFPages object
-
-
Method Details
-
output
Write the PDF represention of this object- Overrides:
output
in classPDFDictionary
- Parameters:
stream
- the stream to write the PDF to- Returns:
- the number of bytes written
- Throws:
IOException
- if there is an error writing to the stream
-
setPageMode
public void setPageMode(int mode) Set the page mode for the PDF document.- Parameters:
mode
- the page mode (one of PAGEMODE_*)
-
getPageMode
public int getPageMode()Returns the currently active /PageMode.- Returns:
- the /PageMode (one of PAGEMODE_*)
-
addPage
add a /Page object to the root /Pages object- Parameters:
page
- the /Page object to add
-
setRootPages
set the root /Pages object- Parameters:
pages
- the /Pages object to set as root
-
getRootPages
Returns the /PageLabels object.- Returns:
- the /PageLabels object if set, null otherwise.
- Since:
- PDF 1.3
-
setPageLabels
Sets the /PageLabels object.- Parameters:
pageLabels
- the /PageLabels object
-
getPageLabels
Returns the /PageLabels object.- Returns:
- the /PageLabels object if set, null otherwise.
- Since:
- PDF 1.3
-
setRootOutline
Set the root outline for the PDF document.- Parameters:
out
- the root PDF Outline
-
getRootOutline
Get the root PDF outline for the document.- Returns:
- the root PDF Outline
-
setNames
Set the /Names object.- Parameters:
names
- the Names object- Since:
- PDF 1.2
-
getNames
Returns the /Names object.- Returns:
- the Names object if set, null otherwise.
- Since:
- PDF 1.2
-
setMetadata
Set the optional Metadata object.- Parameters:
meta
- the Metadata object- Since:
- PDF 1.4
-
getMetadata
Returns the /Metadata object- Returns:
- the /Metadata object if set, null otherwise.
- Since:
- PDF 1.4
-
getOutputIntents
Returns the /OutputIntents array.- Returns:
- the /OutputIntents array or null if it doesn't exist
- Since:
- PDF 1.4
-
addOutputIntent
Adds an OutputIntent to the PDF- Parameters:
outputIntent
- the OutputIntent dictionary- Since:
- PDF 1.4
-
getLanguage
Returns the language identifier of the document.- Returns:
- the language identifier of the document (or null if not set or undefined)
- Since:
- PDF 1.4
-
setLanguage
Sets the locale of the document.- Parameters:
locale
- the locale of the document.
-
setStructTreeRoot
Sets the StructTreeRoot object. Used for accessibility.- Parameters:
structTreeRoot
- of this document
-
getStructTreeRoot
Returns the StructTreeRoot object.- Returns:
- the structure tree root (or null if accessibility is not enabled)
-
makeTagged
public void makeTagged()Marks this document as conforming to the Tagged PDF conventions. -
getMarkInfo
Returns the MarkInfo dictionary.- Returns:
- the MarkInfo dictionary (or null if it's not present)
-
getDPartRoot
-
addAF
-