public class PdfPage extends PdfObjectWrapper<PdfDictionary>
Modifier | Constructor and Description |
---|---|
protected |
PdfPage(PdfDictionary pdfObject) |
protected |
PdfPage(PdfDocument pdfDocument) |
protected |
PdfPage(PdfDocument pdfDocument, PageSize pageSize) |
Modifier and Type | Method and Description |
---|---|
PdfPage |
addAnnotation(int index, PdfAnnotation annotation, boolean tagAnnotation) |
PdfPage |
addAnnotation(PdfAnnotation annotation) |
boolean |
containsAnnotation(PdfAnnotation annotation) |
PdfFormXObject |
copyAsFormXObject(PdfDocument toDocument)
Copies page as FormXObject to the specified document.
|
PdfPage |
copyTo(PdfDocument toDocument)
Copies page to the specified document.
|
PdfPage |
copyTo(PdfDocument toDocument, IPdfPageExtraCopier copier)
Copies page to the specified document.
|
void |
flush()
Flushes page and it's content stream.
|
void |
flush(boolean flushXObjects)
Flushes page and its content stream.
|
List<PdfAnnotation> |
getAnnotations() |
int |
getAnnotsSize() |
Rectangle |
getArtBox() |
byte[] |
getContentBytes()
Get decoded bytes for the whole page content.
|
PdfStream |
getContentStream(int index) |
int |
getContentStreamCount() |
Rectangle |
getCropBox() |
PdfDocument |
getDocument() |
PdfStream |
getFirstContentStream() |
PdfStream |
getLastContentStream() |
Rectangle |
getMediaBox() |
int |
getNextMcid()
Calculates and returns next available MCID reference.
|
List<PdfOutline> |
getOutlines(boolean updateOutlines)
This method gets outlines of a current page
|
Rectangle |
getPageSize() |
Rectangle |
getPageSizeWithRotation()
Gets the rotated page.
|
PdfResources |
getResources() |
int |
getRotation() |
byte[] |
getStreamBytes(int index)
Gets decoded bytes of a certain stream of a page content.
|
Integer |
getStructParentIndex() |
Rectangle |
getTrimBox() |
PdfStream |
getXmpMetadata() |
boolean |
isIgnorePageRotationForContent() |
boolean |
isPageRotationInverseMatrixWritten()
This flag is meaningful for the case, when page rotation is applied and ignorePageRotationForContent is set to true.
|
protected boolean |
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.
|
PdfStream |
newContentStreamAfter() |
PdfStream |
newContentStreamBefore() |
PdfPage |
put(PdfName key, PdfObject value) |
PdfPage |
removeAnnotation(PdfAnnotation annotation)
Removes an annotation from the page.
|
PdfPage |
setAdditionalAction(PdfName key, PdfAction action) |
PdfPage |
setArtBox(Rectangle rectangle) |
PdfPage |
setCropBox(Rectangle rectangle) |
PdfPage |
setIgnorePageRotationForContent(boolean ignorePageRotationForContent)
If true - defines that in case the page has a rotation, then new content will be automatically rotated in the opposite direction.
|
PdfPage |
setMediaBox(Rectangle rectangle) |
PdfPage |
setPageLabel(PageLabelNumberingStyleConstants numberingStyle, String labelPrefix)
This method adds or replaces a page label.
|
PdfPage |
setPageLabel(PageLabelNumberingStyleConstants numberingStyle, String labelPrefix, int firstPage)
This method adds or replaces a page label.
|
void |
setPageRotationInverseMatrixWritten()
NOTE: For internal usage!
|
PdfPage |
setResources(PdfResources pdfResources) |
PdfPage |
setRotation(int degAngle) |
PdfPage |
setTrimBox(Rectangle rectangle) |
void |
setXmpMetadata(byte[] xmpMetadata)
Use this method to set the XMP Metadata for each page.
|
void |
setXmpMetadata(XMPMeta xmpMeta) |
void |
setXmpMetadata(XMPMeta xmpMeta, SerializeOptions serializeOptions) |
ensureObjectIsAddedToDocument, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
protected PdfPage(PdfDictionary pdfObject)
protected PdfPage(PdfDocument pdfDocument, PageSize pageSize)
protected PdfPage(PdfDocument pdfDocument)
public Rectangle getPageSize()
public Rectangle getPageSizeWithRotation()
public int getRotation()
public PdfPage setRotation(int degAngle)
public PdfStream getContentStream(int index)
public int getContentStreamCount()
public PdfStream getFirstContentStream()
public PdfStream getLastContentStream()
public PdfStream newContentStreamBefore()
public PdfStream newContentStreamAfter()
public PdfResources getResources()
public PdfPage setResources(PdfResources pdfResources)
public void setXmpMetadata(byte[] xmpMetadata) throws IOException
xmpMetadata
- The xmpMetadata to set.
IOException
public void setXmpMetadata(XMPMeta xmpMeta, SerializeOptions serializeOptions) throws XMPException, IOException
XMPException
IOException
public void setXmpMetadata(XMPMeta xmpMeta) throws XMPException, IOException
XMPException
IOException
public PdfStream getXmpMetadata() throws XMPException
XMPException
public PdfPage copyTo(PdfDocument toDocument)
toDocument
- a document to copy page to.
public PdfPage copyTo(PdfDocument toDocument, IPdfPageExtraCopier copier)
toDocument
- a document to copy page to.
copier
- a copier which bears a specific copy logic. May be NULL
public PdfFormXObject copyAsFormXObject(PdfDocument toDocument) throws IOException
toDocument
- a document to copy to.
IOException
public PdfDocument getDocument()
public void flush()
flush
in class PdfObjectWrapper<PdfDictionary>
public void flush(boolean flushXObjects)
flushXObjects
is true the images and FormXObjects associated with this page will also be flushed.
PdfPage#flush() method
.
PdfADocument
is used, flushing will be applied only if flushXObjects
is true.
flushXObjects
- if true the images and FormXObjects associated with this page will also be flushed.
public Rectangle getMediaBox()
public Rectangle getCropBox()
public Rectangle getArtBox()
public Rectangle getTrimBox()
public byte[] getContentBytes()
PdfException
- in case any @see IOException.
public byte[] getStreamBytes(int index)
index
- index of stream inside Content.
PdfException
- in case any @see IOException.
public int getNextMcid()
PdfException
public Integer getStructParentIndex()
public List<PdfAnnotation> getAnnotations()
public boolean containsAnnotation(PdfAnnotation annotation)
public PdfPage addAnnotation(PdfAnnotation annotation)
public PdfPage addAnnotation(int index, PdfAnnotation annotation, boolean tagAnnotation)
public PdfPage removeAnnotation(PdfAnnotation annotation)
annotation
- an annotation to be removed.
public int getAnnotsSize()
public List<PdfOutline> getOutlines(boolean updateOutlines)
updateOutlines
-
PdfException
public boolean isIgnorePageRotationForContent()
public PdfPage setIgnorePageRotationForContent(boolean ignorePageRotationForContent)
false
.
ignorePageRotationForContent
- - true to ignore rotation of the new content on the rotated page.
public PdfPage setPageLabel(PageLabelNumberingStyleConstants numberingStyle, String labelPrefix)
numberingStyle
- The numbering style that shall be used for the numeric portion of each page label. May be NULL
labelPrefix
- The label prefix for page labels in this range. May be NULL
public PdfPage setPageLabel(PageLabelNumberingStyleConstants numberingStyle, String labelPrefix, int firstPage)
numberingStyle
- The numbering style that shall be used for the numeric portion of each page label. May be NULL
labelPrefix
- The label prefix for page labels in this range. May be NULL
firstPage
- The value of the numeric portion for the first page label in the range. Must be greater or equal 1.
public boolean isPageRotationInverseMatrixWritten()
setIgnorePageRotationForContent(boolean)
public void setPageRotationInverseMatrixWritten()
setIgnorePageRotationForContent(boolean)
protected boolean isWrappedObjectMustBeIndirect()
PdfObjectWrapper
isWrappedObjectMustBeIndirect
in class PdfObjectWrapper<PdfDictionary>
Copyright © 1998–2016 iText Group NV. All rights reserved.