org.apache.fop.pdf

Class PDFRoot

Implemented Interfaces:
PDFWritable

public class PDFRoot
extends PDFDictionary

Class representing a Root (/Catalog) object.

Field Summary

static int
PAGEMODE_FULLSCREEN
Full screen page mode
static int
PAGEMODE_USENONE
Use no page mode setting, default
static int
PAGEMODE_USEOUTLINES
Use outlines page mode to show bookmarks
static int
PAGEMODE_USETHUMBS
Use thumbs page mode to show thumbnail images

Fields inherited from class org.apache.fop.pdf.PDFDictionary

entries, order

Fields inherited from class org.apache.fop.pdf.PDFObject

DATE_FORMAT, log

Constructor Summary

PDFRoot(int objnum, PDFPages pages)
create a Root (/Catalog) object.

Method Summary

void
addOutputIntent(PDFOutputIntent outputIntent)
Adds an OutputIntent to the PDF
void
addPage(PDFPage page)
add a /Page object to the root /Pages object
String
getLanguage()
Returns the language identifier of the document.
PDFMetadata
getMetadata()
Returns the /Metadata object
PDFNames
getNames()
Returns the /Names object.
PDFArray
getOutputIntents()
Returns the /OutputIntents array.
PDFPageLabels
getPageLabels()
Returns the /PageLabels object.
int
getPageMode()
Returns the currently active /PageMode.
PDFOutline
getRootOutline()
Get the root PDF outline for the document.
PDFPages
getRootPages()
Returns the /PageLabels object.
void
setLanguage(String lang)
Sets the language identifier of the document.
void
setMetadata(PDFMetadata meta)
Set the optional Metadata object.
void
setNames(PDFNames names)
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 object

Methods inherited from class org.apache.fop.pdf.PDFDictionary

get, output, put, put, writeDictionary

Methods inherited from class org.apache.fop.pdf.PDFObject

encode, encodeBinaryToHexString, encodeString, encodeText, formatDateTime, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setParent, toPDF, toPDFString

Field Details

PAGEMODE_FULLSCREEN

public static final int PAGEMODE_FULLSCREEN
Full screen page mode
Field Value:
3

PAGEMODE_USENONE

public static final int PAGEMODE_USENONE
Use no page mode setting, default
Field Value:
0

PAGEMODE_USEOUTLINES

public static final int PAGEMODE_USEOUTLINES
Use outlines page mode to show bookmarks
Field Value:
1

PAGEMODE_USETHUMBS

public static final int PAGEMODE_USETHUMBS
Use thumbs page mode to show thumbnail images
Field Value:
2

Constructor Details

PDFRoot

public PDFRoot(int objnum,
               PDFPages pages)
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 trsailer). (mark-fop@inomial.com)
Parameters:
objnum - the object's number
pages - the PDFPages object

Method Details

addOutputIntent

public void addOutputIntent(PDFOutputIntent outputIntent)
Adds an OutputIntent to the PDF
Parameters:
outputIntent - the OutputIntent dictionary
Since:
PDF 1.4

addPage

public void addPage(PDFPage page)
add a /Page object to the root /Pages object
Parameters:
page - the /Page object to add

getLanguage

public String 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

getMetadata

public PDFMetadata getMetadata()
Returns the /Metadata object
Returns:
the /Metadata object if set, null otherwise.
Since:
PDF 1.4

getNames

public PDFNames getNames()
Returns the /Names object.
Returns:
the Names object if set, null otherwise.
Since:
PDF 1.2

getOutputIntents

public PDFArray getOutputIntents()
Returns the /OutputIntents array.
Returns:
the /OutputIntents array or null if it doesn't exist
Since:
PDF 1.4

getPageLabels

public PDFPageLabels getPageLabels()
Returns the /PageLabels object.
Returns:
the /PageLabels object if set, null otherwise.
Since:
PDF 1.3

getPageMode

public int getPageMode()
Returns the currently active /PageMode.
Returns:
the /PageMode (one of PAGEMODE_*)

getRootOutline

public PDFOutline getRootOutline()
Get the root PDF outline for the document.
Returns:
the root PDF Outline

getRootPages

public PDFPages getRootPages()
Returns the /PageLabels object.
Returns:
the /PageLabels object if set, null otherwise.
Since:
PDF 1.3

setLanguage

public void setLanguage(String lang)
Sets the language identifier of the document.
Parameters:
lang - the language identifier of the document.

setMetadata

public void setMetadata(PDFMetadata meta)
Set the optional Metadata object.
Parameters:
meta - the Metadata object
Since:
PDF 1.4

setNames

public void setNames(PDFNames names)
Set the /Names object.
Parameters:
names - the Names object
Since:
PDF 1.2

setPageLabels

public void setPageLabels(PDFPageLabels pageLabels)
Sets the /PageLabels object.
Parameters:
pageLabels - the /PageLabels object

setPageMode

public void setPageMode(int mode)
Set the page mode for the PDF document.
Parameters:
mode - the page mode (one of PAGEMODE_*)

setRootOutline

public void setRootOutline(PDFOutline out)
Set the root outline for the PDF document.
Parameters:
out - the root PDF Outline

setRootPages

public void setRootPages(PDFPages pages)
set the root /Pages object
Parameters:
pages - the /Pages object to set as root

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.