com.spire.pdf
Class PdfPageBase

java.lang.Object
  extended by com.spire.pdf.PdfPageBase
Direct Known Subclasses:
PdfNewPage, PdfPageWidget

public abstract class PdfPageBase
extends java.lang.Object

The base class for all pages.


Constructor Summary
PdfPageBase(PdfDictionary dic)
          Initializes a new instance of the class.
 
Method Summary
 PdfTemplate createTemplate()
          Creates a template from page content and all annotation appearances.
 void deleteImage(int imageIndex)
          Deprecated. 
 java.awt.image.BufferedImage[] extractImages()
          Deprecated. 
 java.awt.image.BufferedImage[] extractImages(boolean processImage)
          Deprecated. 
 java.awt.geom.Rectangle2D getActualBounds(boolean includeMargins)
          Calculates actual bounds of the page.
 java.awt.geom.Dimension2D getActualSize()
          Gets the actual size of the page.
 boolean getAllowContainTopDocTemplates()
          Gets the template that Allow Contain Top Doc Templates.
 PdfAnnotationCollection getAnnotations()
          Gets a collection of the annotations of the page.
 PdfAnnotationCollection getAnnotationsWidget()
          Gets the field collection.
 java.awt.geom.Rectangle2D getArtBox()
          Returns page region containing content.
 float getBackgroudOpacity()
          Gets the transparency to draw the image
 java.awt.Color getBackgroundColor()
          Gets page's background color.
 java.awt.image.BufferedImage getBackgroundImage()
          Gets page's background image.
 java.awt.geom.Rectangle2D getBackgroundRegion()
          The position and size of the background
 java.awt.geom.Rectangle2D getBleedBox()
          Returns page region after clipping.
 PdfCanvas getCanvas()
          Gets the graphics of the .
 java.awt.geom.Dimension2D getClientSize()
          Returns a page size reduced by page margins and page template dimensions.
 java.awt.geom.Rectangle2D getCropBox()
          Returns the visible region of the page.
 int getDefaultLayerIndex()
          Gets index of the default layer.
 PdfImageInfo[] getImagesInfo()
          Gets the information about the extracted image.
 java.awt.geom.Rectangle2D getMediaBox()
          Returns page region mediabox.
 java.lang.String getPageLabel()
          Get the page label.
 PdfPieceInfo getPagePieceInfo()
          Returns page piece info.
 PdfPageRotateAngle getRotation()
          Gets the page rotation.
 PdfSection getSection()
          Gets the parent section of the page.
 java.awt.geom.Rectangle2D getTrimBox()
          Returns page region after trimming.
 boolean isAutoAdjustContent()
           
 void isAutoAdjustContent(boolean autoAdjustContent)
          some document page content does no start with q and end with Q,so need adjust content.
 boolean isBlank()
          Returns page is blank flag for page's content.
 void releaseExtactImageInfo()
          Release image info.
 void replaceImage(int imageIndex, PdfImage image)
          Deprecated. 
 void setAllowContainTopDocTemplates(boolean value)
          Sets the template that Allow Contain Top Doc Templates.
 void setAnnotationsWidget(PdfAnnotationCollection value)
          Sets the field collection.
 void setArtBox(java.awt.geom.Rectangle2D rect)
          Set art box of the page.
 void setBackgroudOpacity(float value)
          Sets the transparency to draw the image
 void setBackgroundColor(java.awt.Color value)
          Sets page's background color.
 void setBackgroundImage(java.awt.image.BufferedImage image)
          Sets page's background image.
 void setBackgroundImage(java.lang.String imageFileName)
          Sets page's background image.
 void setBackgroundRegion(java.awt.geom.Rectangle2D value)
           
 void setCropBox(java.awt.geom.Rectangle2D rect)
          Set crop box of the page.
 void setDefaultLayerIndex(int value)
          Sets index of the default layer.
 void setPagePieceInfo(PdfPieceInfo pieceInfo)
          Sets the page piece info.
 void setRotation(PdfPageRotateAngle rotateAngle)
          Sets the page rotation.
 void setTabOrder(TabOrder tabOrder)
          Set tab order.
 void setTrimBox(java.awt.geom.Rectangle2D rect)
          Set trim box of the page.
 boolean tryCompressImage(int imgIndex)
          Deprecated. 
 

Constructor Detail

PdfPageBase

public PdfPageBase(PdfDictionary dic)
Initializes a new instance of the class.

Parameters:
dic - The page dictionary.
Method Detail

isAutoAdjustContent

public void isAutoAdjustContent(boolean autoAdjustContent)
some document page content does no start with q and end with Q,so need adjust content.

Parameters:
autoAdjustContent -

isAutoAdjustContent

public boolean isAutoAdjustContent()

isBlank

public boolean isBlank()
Returns page is blank flag for page's content.


getMediaBox

public java.awt.geom.Rectangle2D getMediaBox()
Returns page region mediabox.


getCropBox

public java.awt.geom.Rectangle2D getCropBox()
Returns the visible region of the page.


setCropBox

public void setCropBox(java.awt.geom.Rectangle2D rect)
Set crop box of the page.

Parameters:
rect - The crop box rectangle.

getBleedBox

public java.awt.geom.Rectangle2D getBleedBox()
Returns page region after clipping.


getTrimBox

public java.awt.geom.Rectangle2D getTrimBox()
Returns page region after trimming.


setTrimBox

public void setTrimBox(java.awt.geom.Rectangle2D rect)
Set trim box of the page.

Parameters:
rect - The trim box rectangle.

getArtBox

public java.awt.geom.Rectangle2D getArtBox()
Returns page region containing content.


setArtBox

public void setArtBox(java.awt.geom.Rectangle2D rect)
Set art box of the page.

Parameters:
rect - The art box rectangle.

getAllowContainTopDocTemplates

public boolean getAllowContainTopDocTemplates()
Gets the template that Allow Contain Top Doc Templates.


setAllowContainTopDocTemplates

public void setAllowContainTopDocTemplates(boolean value)
Sets the template that Allow Contain Top Doc Templates.


getActualSize

public java.awt.geom.Dimension2D getActualSize()
Gets the actual size of the page.


getPagePieceInfo

public PdfPieceInfo getPagePieceInfo()
Returns page piece info.


setPagePieceInfo

public void setPagePieceInfo(PdfPieceInfo pieceInfo)
Sets the page piece info.


getAnnotations

public PdfAnnotationCollection getAnnotations()
Gets a collection of the annotations of the page.

Returns:

getAnnotationsWidget

public PdfAnnotationCollection getAnnotationsWidget()
Gets the field collection.


setAnnotationsWidget

public void setAnnotationsWidget(PdfAnnotationCollection value)
Sets the field collection.


getImagesInfo

public PdfImageInfo[] getImagesInfo()
Gets the information about the extracted image.

Throws:
com.spire.ms.System.Exception

getCanvas

public PdfCanvas getCanvas()
Gets the graphics of the .


getSection

public PdfSection getSection()
Gets the parent section of the page.


getDefaultLayerIndex

public int getDefaultLayerIndex()
Gets index of the default layer.


setDefaultLayerIndex

public void setDefaultLayerIndex(int value)
Sets index of the default layer.


getRotation

public PdfPageRotateAngle getRotation()
Gets the page rotation.


setRotation

public void setRotation(PdfPageRotateAngle rotateAngle)
Sets the page rotation.

Parameters:
rotateAngle - rotateAngle

getBackgroundImage

public java.awt.image.BufferedImage getBackgroundImage()
Gets page's background image.


setBackgroundImage

public void setBackgroundImage(java.awt.image.BufferedImage image)
Sets page's background image.

Parameters:
image - The image

setBackgroundImage

public void setBackgroundImage(java.lang.String imageFileName)
Sets page's background image.

Parameters:
imageFileName - The image filename

getBackgroundColor

public java.awt.Color getBackgroundColor()
Gets page's background color.


setBackgroundColor

public void setBackgroundColor(java.awt.Color value)
Sets page's background color.

Parameters:
value - The color.

getPageLabel

public java.lang.String getPageLabel()
Get the page label.


getBackgroudOpacity

public float getBackgroudOpacity()
Gets the transparency to draw the image


setBackgroudOpacity

public void setBackgroudOpacity(float value)
Sets the transparency to draw the image


getBackgroundRegion

public java.awt.geom.Rectangle2D getBackgroundRegion()
The position and size of the background


setBackgroundRegion

public void setBackgroundRegion(java.awt.geom.Rectangle2D value)

getClientSize

public java.awt.geom.Dimension2D getClientSize()
Returns a page size reduced by page margins and page template dimensions.

Returns:
Returns a page size reduced by page margins and page template dimensions.
See Also:
It's the actual size of the page where some output can be performed.

getActualBounds

public java.awt.geom.Rectangle2D getActualBounds(boolean includeMargins)
Calculates actual bounds of the page.

Parameters:
includeMargins - If true - take into consideration Margins.
Returns:
Actual bounds of the page

replaceImage

@Deprecated
public void replaceImage(int imageIndex,
                                    PdfImage image)
Deprecated. 

Replace the Image at index's Position.

Parameters:
imageIndex - index of an image
image - The New Replace image

createTemplate

public PdfTemplate createTemplate()
Creates a template from page content and all annotation appearances.

Returns:
The created template.

extractImages

@Deprecated
public java.awt.image.BufferedImage[] extractImages()
Deprecated. 

Extracts images from the given PDF Page.

Returns:
Returns the extracted image as Image[].

releaseExtactImageInfo

public void releaseExtactImageInfo()
Release image info.


extractImages

@Deprecated
public java.awt.image.BufferedImage[] extractImages(boolean processImage)
Deprecated. 

Extracts images from the given PDF Page. and image is not processed.

Returns:
Returns the extracted image as Image[].

deleteImage

@Deprecated
public void deleteImage(int imageIndex)
Deprecated. 

Delete an image by index in a page.

Parameters:
imageIndex - The image index.

tryCompressImage

@Deprecated
public boolean tryCompressImage(int imgIndex)
Deprecated. 

Try to compress images(except inline image).

Parameters:
imgIndex - The image index
Throws:
com.spire.ms.System.Exception

setTabOrder

public void setTabOrder(TabOrder tabOrder)
Set tab order.

Parameters:
tabOrder - The order name