org.apache.fop.pdf

Class PDFPage

Implemented Interfaces:
PDFWritable

public class PDFPage
extends PDFResourceContext

Class representing a /Page object.

There is one of these for every page in a PDF document. The object specifies the dimensions of the page and references a /Resources object, a contents stream and the page's parent in the page hierarchy.

Field Summary

protected int
pageIndex
the page index (zero-based)

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

PDFPage(PDFResources resources, int pageWidth, int pageHeight, int pageIndex)
Create a /Page object
PDFPage(PDFResources resources, PDFStream contents, int pageWidth, int pageHeight, int pageIndex)
Create a /Page object

Method Summary

int
getPageIndex()
void
setBleedBox(Rectangle2D box)
Sets the "BleedBox" entry
void
setContents(PDFStream contents)
set this page contents
void
setMediaBox(Rectangle2D box)
Sets the "MediaBox" entry
void
setParent(PDFPages parent)
set this page's parent
void
setTransition(int dur, TransitionDictionary tr)
Set the transition dictionary and duration.
void
setTrimBox(Rectangle2D box)
Sets the "TrimBox" entry

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

addAnnotation, addGState, addShading, getAnnotations, getPDFResources

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

pageIndex

protected int pageIndex
the page index (zero-based)

Constructor Details

PDFPage

public PDFPage(PDFResources resources,
               int pageWidth,
               int pageHeight,
               int pageIndex)
Create a /Page object
Parameters:
resources - the /Resources object
pageWidth - the page's width in points
pageHeight - the page's height in points
pageIndex - the page's zero-based index (or -1 if the page number is auto-determined)

PDFPage

public PDFPage(PDFResources resources,
               PDFStream contents,
               int pageWidth,
               int pageHeight,
               int pageIndex)
Create a /Page object
Parameters:
resources - the /Resources object
contents - the content stream
pageWidth - the page's width in points
pageHeight - the page's height in points
pageIndex - the page's zero-based index (or -1 if the page number is auto-determined)

Method Details

getPageIndex

public int getPageIndex()
Returns:
the page Index of this page (zero-based), -1 if it the page index should automatically be determined.

setBleedBox

public void setBleedBox(Rectangle2D box)
Sets the "BleedBox" entry
Parameters:
box - the bleed rectangle

setContents

public void setContents(PDFStream contents)
set this page contents
Parameters:
contents - the contents of the page

setMediaBox

public void setMediaBox(Rectangle2D box)
Sets the "MediaBox" entry
Parameters:
box - the media rectangle

setParent

public void setParent(PDFPages parent)
set this page's parent
Parameters:
parent - the /Pages object that is this page's parent

setTransition

public void setTransition(int dur,
                          TransitionDictionary tr)
Set the transition dictionary and duration. This sets the duration of the page and the transition dictionary used when going to the next page.
Parameters:
dur - the duration in seconds
tr - the transition dictionary

setTrimBox

public void setTrimBox(Rectangle2D box)
Sets the "TrimBox" entry
Parameters:
box - the trim rectangle

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