Package com.itextpdf.text.pdf
Class PdfPage
- java.lang.Object
-
- com.itextpdf.text.pdf.PdfObject
-
- com.itextpdf.text.pdf.PdfDictionary
-
- com.itextpdf.text.pdf.PdfPage
-
- All Implemented Interfaces:
java.io.Serializable
public class PdfPage extends PdfDictionary
PdfPage
is the PDF Page-object.A Page object is a dictionary whose keys describe a single page containing text, graphics, and images. A Page object is a leaf of the Pages tree.
This object is described in the 'Portable Document Format Reference Manual version 1.3' section 6.4 (page 73-81)- See Also:
PdfPages
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static PdfName[]
boxNames
private static java.lang.String[]
boxStrings
static PdfNumber
INVERTEDPORTRAIT
value of the Rotate key for a page in INVERTEDPORTRAITstatic PdfNumber
LANDSCAPE
value of the Rotate key for a page in LANDSCAPE(package private) PdfRectangle
mediaBox
value of the MediaBox keystatic PdfNumber
PORTRAIT
value of the Rotate key for a page in PORTRAITstatic PdfNumber
SEASCAPE
value of the Rotate key for a page in SEASCAPE
-
Constructor Summary
Constructors Constructor Description PdfPage(PdfRectangle mediaBox, java.util.HashMap<java.lang.String,PdfRectangle> boxSize, PdfDictionary resources)
Constructs aPdfPage
.PdfPage(PdfRectangle mediaBox, java.util.HashMap<java.lang.String,PdfRectangle> boxSize, PdfDictionary resources, int rotate)
Constructs aPdfPage
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
add(PdfIndirectReference contents)
Adds an indirect reference pointing to aPdfContents
-object.(package private) PdfRectangle
getMediaBox()
Returns the MediaBox of this Page.boolean
isParent()
Checks if this page element is a tree of pages.(package private) PdfRectangle
rotateMediaBox()
Rotates the mediabox, but not the text in it.-
Methods inherited from class com.itextpdf.text.pdf.PdfDictionary
checkType, clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toPdf, toString
-
Methods inherited from class com.itextpdf.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
-
-
-
Field Detail
-
boxStrings
private static final java.lang.String[] boxStrings
-
boxNames
private static final PdfName[] boxNames
-
PORTRAIT
public static final PdfNumber PORTRAIT
value of the Rotate key for a page in PORTRAIT
-
LANDSCAPE
public static final PdfNumber LANDSCAPE
value of the Rotate key for a page in LANDSCAPE
-
INVERTEDPORTRAIT
public static final PdfNumber INVERTEDPORTRAIT
value of the Rotate key for a page in INVERTEDPORTRAIT
-
SEASCAPE
public static final PdfNumber SEASCAPE
value of the Rotate key for a page in SEASCAPE
-
mediaBox
PdfRectangle mediaBox
value of the MediaBox key
-
-
Constructor Detail
-
PdfPage
PdfPage(PdfRectangle mediaBox, java.util.HashMap<java.lang.String,PdfRectangle> boxSize, PdfDictionary resources, int rotate) throws DocumentException
Constructs aPdfPage
.- Parameters:
mediaBox
- a value for the MediaBox keyresources
- an indirect reference to aPdfResources
-objectrotate
- a value for the Rotate key- Throws:
DocumentException
-
PdfPage
PdfPage(PdfRectangle mediaBox, java.util.HashMap<java.lang.String,PdfRectangle> boxSize, PdfDictionary resources) throws DocumentException
Constructs aPdfPage
.- Parameters:
mediaBox
- a value for the MediaBox keyresources
- an indirect reference to aPdfResources
-object- Throws:
DocumentException
-
-
Method Detail
-
isParent
public boolean isParent()
Checks if this page element is a tree of pages.This method always returns
false
.- Returns:
false
because this is a single page
-
add
void add(PdfIndirectReference contents)
Adds an indirect reference pointing to aPdfContents
-object.- Parameters:
contents
- an indirect reference to aPdfContents
-object
-
rotateMediaBox
PdfRectangle rotateMediaBox()
Rotates the mediabox, but not the text in it.- Returns:
- a
PdfRectangle
-
getMediaBox
PdfRectangle getMediaBox()
Returns the MediaBox of this Page.- Returns:
- a
PdfRectangle
-
-