Page

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.IDisposable, java.io.Closeable, com.aspose.pdf.ISupportsMemoryCleanup, com.aspose.pdf.engine.IOperatorContainer

public final class Page implements System.IDisposable, Closeable, ISupportsMemoryCleanup, IOperatorContainer

Class representing page of PDF document.

Methods

MethodDescription
isAddParagraphsAfterLast()Gets or sets the addition of paragraphs after the last paragraph of the page
setAddParagraphsAfterLast(boolean value)Gets or sets the addition of paragraphs after the last paragraph of the page
getBackgroundImage()Gets or sets background image for page (for generator only, not filled in when reading document).
setBackgroundImage(Image value)Gets or sets background image for page (for generator only, not filled in when reading document).
getTocInfo()Gets table of contents info.
setTocInfo(TocInfo value)Sets table of contents info.
getHeader()Gets page header.
setHeader(HeaderFooter value)Sets page header.
getLayers()Gets layers collection.
setLayers(ArrayList value)Sets layers collection.
setLayersInternal(System.Collections.Generic.List value)Sets layers collection.
getFooter()Gets page Footer.
setFooter(HeaderFooter value)Sets page Footer.
getParagraphs()Gets the paragraphs.
setParagraphs(Paragraphs value)Sets the paragraphs.
getPageInfo()Gets the page info.(for generator only, not filled in when reading document).
setPageInfo(PageInfo value)Sets the page info.(for generator only, not filled in when reading document).
convertToPNGMemoryStream()Convert page to PNG for DSR, OMR, OCR image stream.
addGraphics(GraphicElementCollection elements)Adds graphics to the page.
addGraphics(GraphicElementCollection elements, Rectangle rectangle)Adds graphics to the page.
deleteGraphics(GraphicElementCollection elementsToDelete)Deletes graphics from the page.
trySaveVectorGraphics(String pathToSave)Tries to save vector graphics if they are present on the page.
hasVectorGraphics()Detect of the presence of vector graphics, if it is present on the page.
getOnBeforePageGenerate()Event for customize header and footer.
getEnginePage()For Internal usage only
setEnginePage(IPage enginePage)For Internal usage only
getDocument()Get document
getRect_Rename_Namesake()Returns rectangle of the page according to its CropBox and MediaBox;
getRect()Returns rectangle of the page according to its CropBox and MediaBox; For get: page crop box is returned if specified, otherwise page media box is returned.
setRect(Rectangle value)Gets or sets rectangle of the page.
getColorType()Gets color type of the pages based on information getting from operators SetColor, images and forms.
getNoteLineStyle()Gets the line style for notes.(for generator only, not filled in when reading document)
setNoteLineStyle(GraphInfo value)Sets the line style for notes.(for generator only, not filled in when reading document)
isBlank(double fillThresholdFactor)Gets the flag whether page is blank or not.
getPageRect(boolean considerRotation)Returns rectangle of the page according to its CropBox (or MediaBox if CropBox null).
calculateContentBBox()Calculates bbox value - rectangle containing contents without visible margins.
getTabOrder()Gets tab order of the page.
setTabOrder(int value)Sets tab order of the page.
getDuration()Gets page display duration.
setDuration(double value)Sets page display duration.
getContents()Gets collection of operators in the content stream of the page.
getGroup()Gets a group attributes class specifying the attributes of the page’s page group for use in the transparent imaging model.
setGroup(Group value)Sets a group attributes class specifying the attributes of the page’s page group for use in the transparent imaging model.
getAnnotations()Gets collection of page annotations.
getResources()Gets page resources.
getRotate()Gets rotation of the page.
setRotate(int value)Sets rotation of the page.
getTrimBox()Gets trim box of the page.
setTrimBox(Rectangle value)Sets trim box of the page.
getArtBox()Gets art box of the page.
setArtBox(Rectangle value)Sets art box of the page.
getBleedBox()Gets bleed box of the page.
setBleedBox(Rectangle value)Sets bleed box of the page.
getCropBox()Gets crop box of the page.
setCropBox(Rectangle value)Sets crop box of the page.
getMediaBox()Gets media box of the page.
setMediaBox(Rectangle value)Sets media box of the page.
sendTo(PageDevice device, OutputStream output)Sends page to process with given page device.
accept(AnnotationSelector visitor)Accepts AnnotationSelector visitor object that provides functionality to work with annotations.
rotationToInt(int rotation)Translates rotation enumeration member into integer value.
intToRotation(int rotation)Translates integer value into corresponding rotation enumeration member.
addStamp(Stamp stamp)Put stamp into page.
addImage(InputStream imageStream, Rectangle imageRect)Adds image onto the page and locates it in the middle of specified rectangle saving image’s proportion.
addImage(String hocr, InputStream imageStream, Rectangle imageRect)Adds searchable image onto the page and locates it in the middle of specified rectangle saving image’s proportion.
addImage(InputStream imageStream, Rectangle imageRect, int imageWidth, int imageHeight, boolean saveImageProportions)Adds searchable image onto the page and locates it in the middle of specified rectangle saving image’s proportion.
addImage(String imagePath, Rectangle rectangle)Adds image onto the page and locates it in the middle of specified rectangle saving image’s proportion.
addImage(InputStream stream, Rectangle rectangle, CompositingParameters compositingParameters)Adds image onto the page and locates it in the middle of specified rectangle saving image’s proportion.
sendTo(PageDevice device, String outputFileName)Sends page to process with given page device.
flatten()Removes all static fields located on the page and place their values instead.
accept(TextFragmentAbsorber visitor)Accepts TextFragmentAbsorber visitor object that provides functionality to work with text objects.
accept(ImagePlacementAbsorber visitor)Accepts ImagePlacementAbsorber visitor object that provides functionality to work with image placement objects.
accept(TextAbsorber visitor)Accepts TextAbsorber visitor object that provides functionality to work with text objects.
setPageSize(double width, double height)Sets page size for page.
setTransition(IPdfDictionary transition)Set transition
getNumber()Get number of the page.
getRotationMatrix()Gets transfomation matrix for the page.
getContentsAppender()Gets current contents appender.
getBackground()Gets the background color of the page.
setBackground(Color value)Sets the background color of the page.
setBackground(Color value)Sets the background color of the page.
getWatermark()Gets the watermark of the page.
setWatermark(Watermark value)Sets the watermark of the page.
removeObjectReferences(String name)Remove references to XObject from page contents (i.e.
removeObjectReferences(OperatorCollection contents, String name)Remove object references
findReferences(String name)Find references
findReferences(OperatorCollection contents, String name)Returns list of operators which uses resource with specified name.
close()Closes all resources used by this document.
dispose()Frees up memory
fillUsedObjectsTable(System.Collections.Generic.Dictionary<Integer,Integer> usageTable, IPdfDictionary CommonResources)
deleteUnusedResources(System.Collections.Generic.Dictionary<Integer,Integer> usageTable)
clearContents()For internal usage only
getArtifacts()Gets collection of artifacts on the page.
getActions()Gets collection of page properties.
makeGrayscale()Converts the page to grayscale.
freeMemory()Clears cached data
getNotifications()Returns notifications about inside operations with page content.
asByteArray(Resolution resolution)Converts current page as BMP bitmap and than returns array of bytes.
asXml()Converts current page as xml in utf8 encoding.
getFieldsInTabOrder()Gets list of Field object in Tab order on this page.
getUserUnit()Gets or sets UserUnit value.
setUserUnit(double value)Gets or sets UserUnit value.

isAddParagraphsAfterLast()

public final boolean isAddParagraphsAfterLast()

Gets or sets the addition of paragraphs after the last paragraph of the page

Value: Value indicates whether paragraphs will be added after the last paragraph of the page. Paragraphs will be added after the last paragraph of the page if value is true.

Returns: boolean - boolean value

setAddParagraphsAfterLast(boolean value)

public final void setAddParagraphsAfterLast(boolean value)

Gets or sets the addition of paragraphs after the last paragraph of the page

Value: Value indicates whether paragraphs will be added after the last paragraph of the page. Paragraphs will be added after the last paragraph of the page if value is true.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getBackgroundImage()

public final Image getBackgroundImage()

Gets or sets background image for page (for generator only, not filled in when reading document).

Returns: Image - Image instance

setBackgroundImage(Image value)

public final void setBackgroundImage(Image value)

Gets or sets background image for page (for generator only, not filled in when reading document).

Parameters:

ParameterTypeDescription
valueImageImage instance

getTocInfo()

public TocInfo getTocInfo()

Gets table of contents info.

Returns: TocInfo - The table of contents info - default null. If it set this page will contain table of contents.

setTocInfo(TocInfo value)

public void setTocInfo(TocInfo value)

Sets table of contents info.

Parameters:

ParameterTypeDescription
valueTocInfoThe table of contents info - default null. If it set this page will contain table of contents.

getHeader()

public HeaderFooter getHeader()

Gets page header.

Returns: HeaderFooter - The page header.

setHeader(HeaderFooter value)

public void setHeader(HeaderFooter value)

Sets page header.

Parameters:

ParameterTypeDescription
valueHeaderFooterThe page header.

getLayers()

public List<Layer> getLayers()

Gets layers collection.

Returns: java.util.List<com.aspose.pdf.Layer> - Value: The layers’ collection.

setLayers(ArrayList value)

public void setLayers(ArrayList<Layer> value)

Sets layers collection.

Parameters:

ParameterTypeDescription
valuejava.util.ArrayList<com.aspose.pdf.Layer>: The layers collection.

setLayersInternal(System.Collections.Generic.List value)

public void setLayersInternal(System.Collections.Generic.List<Layer> value)

Sets layers collection.

Parameters:

ParameterTypeDescription
valuecom.aspose.ms.System.Collections.Generic.List<com.aspose.pdf.Layer>: The layers collection.

getFooter()

public HeaderFooter getFooter()

Gets page Footer.

Returns: HeaderFooter - The page Footer.

setFooter(HeaderFooter value)

public void setFooter(HeaderFooter value)

Sets page Footer.

Parameters:

ParameterTypeDescription
valueHeaderFooterThe page Footer.

getParagraphs()

public Paragraphs getParagraphs()

Gets the paragraphs.

Returns: Paragraphs - The paragraphs.

setParagraphs(Paragraphs value)

public void setParagraphs(Paragraphs value)

Sets the paragraphs.

Parameters:

ParameterTypeDescription
valueParagraphsParagraphs value

getPageInfo()

public PageInfo getPageInfo()

Gets the page info.(for generator only, not filled in when reading document).

Returns: PageInfo - The page info.

setPageInfo(PageInfo value)

public void setPageInfo(PageInfo value)

Sets the page info.(for generator only, not filled in when reading document).

Parameters:

ParameterTypeDescription
valuePageInfoThe page info.

convertToPNGMemoryStream()

public byte[] convertToPNGMemoryStream()

Convert page to PNG for DSR, OMR, OCR image stream.

Returns: byte[] - Image stream in byte[] array.

addGraphics(GraphicElementCollection elements)

public final void addGraphics(GraphicElementCollection elements)

Adds graphics to the page. Works faster than adding elements one by one with GraphicElement#addOnPage(Page) method.

Parameters:

ParameterTypeDescription
elementsGraphicElementCollectionGraphics collection.

addGraphics(GraphicElementCollection elements, Rectangle rectangle)

public final void addGraphics(GraphicElementCollection elements, Rectangle rectangle)

Adds graphics to the page. Works faster than adding elements one by one with GraphicElement#addOnPage(Page) method.

Parameters:

ParameterTypeDescription
elementsGraphicElementCollectionGraphics collection.
rectangleRectangleElements will be added to the page if it’s (/) is inside the rectangle area. If rectangle is null, all graphic elements will be added

deleteGraphics(GraphicElementCollection elementsToDelete)

public final void deleteGraphics(GraphicElementCollection elementsToDelete)

Deletes graphics from the page. Works faster than deleting elements one by one with GraphicElement#remove method.

Parameters:

ParameterTypeDescription
elementsToDeleteGraphicElementCollectionGraphics collection that will be deleted from the page.

trySaveVectorGraphics(String pathToSave)

public final boolean trySaveVectorGraphics(String pathToSave)

Tries to save vector graphics if they are present on the page. The save format is SVG.

Parameters:

ParameterTypeDescription
pathToSavejava.lang.StringOutput file

Returns: boolean - True if the page contains path construction operators; otherwise, False.

hasVectorGraphics()

public final boolean hasVectorGraphics()

Detect of the presence of vector graphics, if it is present on the page.

Returns: boolean - True if the page contains path construction operators; otherwise, False.

getOnBeforePageGenerate()

public PdfEvent<Page.BeforePageGenerate> getOnBeforePageGenerate()

Event for customize header and footer.

Returns: PdfEvent - PdfEvent instance

getEnginePage()

public IPage getEnginePage()

For Internal usage only

Returns: IPage - internal instance

setEnginePage(IPage enginePage)

public void setEnginePage(IPage enginePage)

For Internal usage only

Parameters:

ParameterTypeDescription
enginePageIPageinternal instance

getDocument()

public IDocument getDocument()

Get document

Returns: IDocument - IDocument object

getRect_Rename_Namesake()

public Rectangle getRect_Rename_Namesake()

Returns rectangle of the page according to its CropBox and MediaBox;

Internal

Returns: Rectangle - Rectangle value


Example demonstrates how to get page rectangle:

 Document document = new Document("sample.pdf");
 Page page = document.getPages().get(1);
 Rectangle pageRect = page.getRect();

getRect()

public Rectangle getRect()

Returns rectangle of the page according to its CropBox and MediaBox; For get: page crop box is returned if specified, otherwise page media box is returned. For set: page media box always set.

Returns: Rectangle - Rectangle value


Example demonstrates how to get page rectangle:

 Document document = new Document("sample.pdf");
 Page page = document.getPages().get(1);
 Rectangle pageRect = page.getRect();

setRect(Rectangle value)

public void setRect(Rectangle value)

Gets or sets rectangle of the page. For get: page crop box is returned if specified, otherwise page media box is returned. For set: page media box always set. is returned. Please note that this property don’t consider page rotation. To get page rectangle considering rotation please use ActualRect.

Parameters:

ParameterTypeDescription
valueRectangleRectangle object

getColorType()

public int getColorType()

Gets color type of the pages based on information getting from operators SetColor, images and forms.

Returns: int - ColorType element

getNoteLineStyle()

public GraphInfo getNoteLineStyle()

Gets the line style for notes.(for generator only, not filled in when reading document)

Returns: GraphInfo - GraphInfo value

setNoteLineStyle(GraphInfo value)

public void setNoteLineStyle(GraphInfo value)

Sets the line style for notes.(for generator only, not filled in when reading document)

Parameters:

ParameterTypeDescription
valueGraphInfo: GraphInfo value

isBlank(double fillThresholdFactor)

public boolean isBlank(double fillThresholdFactor)

Gets the flag whether page is blank or not.

Parameters:

ParameterTypeDescription
fillThresholdFactordoubleThe fill threshold value that manages the sensitivity of detection. Should be equal or greater than 0.01.

Returns: boolean - boolean value True - if page is blank; otherwise, false.

getPageRect(boolean considerRotation)

public Rectangle getPageRect(boolean considerRotation)

Returns rectangle of the page according to its CropBox (or MediaBox if CropBox null).

Parameters:

ParameterTypeDescription
considerRotationbooleanIf true then rotation of the page will be considered in rect calculation.

Returns: Rectangle - Rectangle of the page.

calculateContentBBox()

public Rectangle calculateContentBBox()

Calculates bbox value - rectangle containing contents without visible margins.

Returns: Rectangle - Bbox value - rectangle containing contents without visible margins

getTabOrder()

public int getTabOrder()

Gets tab order of the page. Possible values: Row, Column. Default, Manual

Returns: int - TabOrder value

setTabOrder(int value)

public void setTabOrder(int value)

Sets tab order of the page. Possible values: Row, Column. Default, Manual

Parameters:

ParameterTypeDescription
valueintTabOrder object

getDuration()

public double getDuration()

Gets page display duration. This is time in seconds that page shall be displayed during presentation. Returns -1 if duration is not defined.


Example demonstrates how to get page duration

Document document = new Document(“sample.pdf”); Page page = document.getPages().get(1); int pageRect = page.getDuration();

Returns: double - double value

setDuration(double value)

public void setDuration(double value)

Sets page display duration. This is time in seconds that page shall be displayed during presentation. Returns -1 if duration is not defined.

Parameters:

ParameterTypeDescription
valuedoublepage display duration.

getContents()

public OperatorCollection getContents()

Gets collection of operators in the content stream of the page. OperatorCollection

Returns: OperatorCollection - OperatorCollection object


Example is demonstrates how to scan operators stream of page.


 Document document = new Document("sample.pdf");
 Operators contents = document.getPages().get_Item(1).getContents();
 for(Operator op : ```
(Iterable)
```contents)
 {
     System.out.println(op);
 }

getGroup()

public Group getGroup()

Gets a group attributes class specifying the attributes of the page’s page group for use in the transparent imaging model.

Returns: Group - Group value

setGroup(Group value)

public void setGroup(Group value)

Sets a group attributes class specifying the attributes of the page’s page group for use in the transparent imaging model.

Parameters:

ParameterTypeDescription
valueGroupGroup value

getAnnotations()

public AnnotationCollection getAnnotations()

Gets collection of page annotations. Annotations

Returns: AnnotationCollection - AnnotationCollection value

getResources()

public Resources getResources()

Gets page resources. Resources object contains collections of images, forms and fonts. Resources

Returns: Resources - Resources value


Example demonstrates scan through page images:


 Document document = new Document("sample.pdf");
 DocumentActions actions = document.getActions();
 Resources resources = document.getPages().get(1).getResources();
 for(XImage image : ```
(Ierable)resources
```.getImages())
 {
   System.out.println(image.getWidth() + ":" + image.getHeight());
 }

getRotate()

public int getRotate()

Gets rotation of the page.

Returns: int - Rotation element


Example demonstrates how to determine page rotation.


 Document document = new Document("sample.pdf");
 System.out.println(document.getPages().get(1).getRotate());

setRotate(int value)

public void setRotate(int value)

Sets rotation of the page.

Parameters:

ParameterTypeDescription
valueintRotation element

getTrimBox()

public Rectangle getTrimBox()

Gets trim box of the page.

Returns: Rectangle - Rectangle value


Example demonstrates how to get trim box of the page:


 Document document = new Document("sample.pdf");
 Rectangle trimBox = document.getPages().get(1).getTrimBox();

setTrimBox(Rectangle value)

public void setTrimBox(Rectangle value)

Sets trim box of the page.

Parameters:

ParameterTypeDescription
valueRectangleRectangle value

getArtBox()

public Rectangle getArtBox()

Gets art box of the page.

Returns: Rectangle - Rectangle value


Example demonstrates how to get art box of the page:


 Document document = new Document("sample.pdf");
 Rectangle artBox = document.getPages().get(1).getArtBox();

setArtBox(Rectangle value)

public void setArtBox(Rectangle value)

Sets art box of the page.

Parameters:

ParameterTypeDescription
valueRectangleRectangle value

getBleedBox()

public Rectangle getBleedBox()

Gets bleed box of the page.

Returns: Rectangle - Rectangle value


Example demonstrates how to get bleed box of the page:


 Document document = new Document("sample.pdf");
 Rectangle bleedBox = document.getPages().get(1).getBleedBox();

setBleedBox(Rectangle value)

public void setBleedBox(Rectangle value)

Sets bleed box of the page.

Parameters:

ParameterTypeDescription
valueRectangleRectangle value

getCropBox()

public Rectangle getCropBox()

Gets crop box of the page.

Returns: Rectangle - Rectangle value


Example demonstrates how to get crop box of the page:


 Document document = new Document("sample.pdf");
 Rectangle cropBox = document.getPages().get_Item(1).getCropBox();

setCropBox(Rectangle value)

public void setCropBox(Rectangle value)

Sets crop box of the page.


Example demonstrates how to get crop box of the page:


 Document document = new Document("sample.pdf");
 document.getPages().get_Item(1).setCropBox(new Rectangle(0d,0d,100d,100d));

Parameters:

ParameterTypeDescription
valueRectangleRectangle object

getMediaBox()

public Rectangle getMediaBox()

Gets media box of the page.

Returns: Rectangle - Rectangle value


Example demonstrates how to get media box of the page:


 Document document = new Document("sample.pdf");
 Rectangle mediaBox = document.getPages().get(1).getMediaBox();

setMediaBox(Rectangle value)

public void setMediaBox(Rectangle value)

Sets media box of the page.

Parameters:

ParameterTypeDescription
valueRectangleRectangle

sendTo(PageDevice device, OutputStream output)

public void sendTo(PageDevice device, OutputStream output)

Sends page to process with given page device.

Parameters:

ParameterTypeDescription
devicePageDeviceThe device to process page.
outputjava.io.OutputStreamResult stream which is used with device to save its output.

accept(AnnotationSelector visitor)

public void accept(AnnotationSelector visitor)

Accepts AnnotationSelector visitor object that provides functionality to work with annotations.

Parameters:

ParameterTypeDescription
visitorAnnotationSelectorAnnotation selector sobject.

rotationToInt(int rotation)

public static int rotationToInt(int rotation)

Translates rotation enumeration member into integer value.

Parameters:

ParameterTypeDescription
rotationintRotation enumeratioom member.

Returns: int - Corresponding integer value

intToRotation(int rotation)

public static int intToRotation(int rotation)

Translates integer value into corresponding rotation enumeration member.

Parameters:

ParameterTypeDescription
rotationintInteger value to convert

Returns: int - Rotation enumeration member

addStamp(Stamp stamp)

public void addStamp(Stamp stamp)

Put stamp into page. Stamp can be page number, image or simple text, e.g. some logo.

Parameters:

ParameterTypeDescription
stampStampStamp to add on the page. Each stamp has its coordinates and corresponding properties regarding to the kind of stamp, i.e. image or text value.

addImage(InputStream imageStream, Rectangle imageRect)

public void addImage(InputStream imageStream, Rectangle imageRect)

Adds image onto the page and locates it in the middle of specified rectangle saving image’s proportion.

Parameters:

ParameterTypeDescription
imageStreamjava.io.InputStreamThe stream of the image.
imageRectRectangleThe position of the image.

addImage(String hocr, InputStream imageStream, Rectangle imageRect)

public void addImage(String hocr, InputStream imageStream, Rectangle imageRect)

Adds searchable image onto the page and locates it in the middle of specified rectangle saving image’s proportion.

Parameters:

ParameterTypeDescription
hocrjava.lang.StringThe hocr of the image.
imageStreamjava.io.InputStreamThe stream of the image.
imageRectRectangleThe position of the image.

addImage(InputStream imageStream, Rectangle imageRect, int imageWidth, int imageHeight, boolean saveImageProportions)

public void addImage(InputStream imageStream, Rectangle imageRect, int imageWidth, int imageHeight, boolean saveImageProportions)

Adds searchable image onto the page and locates it in the middle of specified rectangle saving image’s proportion.

Parameters:

ParameterTypeDescription
imageStreamjava.io.InputStreamInputStream object
imageRectRectangleRectangle object
imageWidthintint value
imageHeightintint value
saveImageProportionsbooleanboolean value

addImage(String imagePath, Rectangle rectangle)

public void addImage(String imagePath, Rectangle rectangle)

Adds image onto the page and locates it in the middle of specified rectangle saving image’s proportion.

Parameters:

ParameterTypeDescription
imagePathjava.lang.StringThe path to image.
rectangleRectangleThe position of the image.

addImage(InputStream stream, Rectangle rectangle, CompositingParameters compositingParameters)

public void addImage(InputStream stream, Rectangle rectangle, CompositingParameters compositingParameters)

Adds image onto the page and locates it in the middle of specified rectangle saving image’s proportion.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamThe stream of the image.
rectangleRectangleThe position of the image.
compositingParametersCompositingParametersThe compositing parameters.

sendTo(PageDevice device, String outputFileName)

public void sendTo(PageDevice device, String outputFileName)

Sends page to process with given page device.

Parameters:

ParameterTypeDescription
devicePageDeviceThe device to process page.
outputFileNamejava.lang.StringFile which is used with device to save its output.

flatten()

public void flatten()

Removes all static fields located on the page and place their values instead.

accept(TextFragmentAbsorber visitor)

public void accept(TextFragmentAbsorber visitor)

Accepts TextFragmentAbsorber visitor object that provides functionality to work with text objects.

Parameters:

ParameterTypeDescription
visitorTextFragmentAbsorberText absorber object.

accept(ImagePlacementAbsorber visitor)

public void accept(ImagePlacementAbsorber visitor)

Accepts ImagePlacementAbsorber visitor object that provides functionality to work with image placement objects.

Parameters:

ParameterTypeDescription
visitorImagePlacementAbsorberImage placement absorber object.

accept(TextAbsorber visitor)

public void accept(TextAbsorber visitor)

Accepts TextAbsorber visitor object that provides functionality to work with text objects.

Parameters:

ParameterTypeDescription
visitorTextAbsorberText absorber object.

setPageSize(double width, double height)

public void setPageSize(double width, double height)

Sets page size for page.

Parameters:

ParameterTypeDescription
widthdoublePage width.
heightdoublePage size.

setTransition(IPdfDictionary transition)

public void setTransition(IPdfDictionary transition)

Set transition

Parameters:

ParameterTypeDescription
transitionIPdfDictionaryIPdfDictionary object

getNumber()

public final int getNumber()

Get number of the page.

Returns: int - int value

getRotationMatrix()

public Matrix getRotationMatrix()

Gets transfomation matrix for the page.

Returns: Matrix - Matrix value

getContentsAppender()

public ContentsAppender getContentsAppender()

Gets current contents appender. ContentsAppender

Returns: ContentsAppender - ContentsAppender value

getBackground()

public Color getBackground()

Gets the background color of the page.

Returns: Color - Color value

setBackground(Color value)

public void setBackground(Color value)

Sets the background color of the page.

Parameters:

ParameterTypeDescription
valuejava.awt.ColorColor object

setBackground(Color value)

public void setBackground(Color value)

Sets the background color of the page.

Parameters:

ParameterTypeDescription
valueColorColor object

getWatermark()

public Watermark getWatermark()

Gets the watermark of the page.

Returns: Watermark - Watermark value

setWatermark(Watermark value)

public void setWatermark(Watermark value)

Sets the watermark of the page.

Parameters:

ParameterTypeDescription
valueWatermarkWatermark object

removeObjectReferences(String name)

public void removeObjectReferences(String name)

Remove references to XObject from page contents (i.e. all Do operators which use name of object).

Parameters:

ParameterTypeDescription
namejava.lang.StringString value

removeObjectReferences(OperatorCollection contents, String name)

public static void removeObjectReferences(OperatorCollection contents, String name)

Remove object references

Parameters:

ParameterTypeDescription
contentsOperatorCollectionOperatorCollection object
namejava.lang.Stringvalue

findReferences(String name)

public List<Object> findReferences(String name)

Find references

Parameters:

ParameterTypeDescription
namejava.lang.StringString value

Returns: java.util.List<java.lang.Object> - List object

findReferences(OperatorCollection contents, String name)

public static List<Object> findReferences(OperatorCollection contents, String name)

Returns list of operators which uses resource with specified name.

Parameters:

ParameterTypeDescription
contentsOperatorCollectionOperatorCollection value
namejava.lang.StringString value

Returns: java.util.List<java.lang.Object> - List of Object

close()

public void close()

Closes all resources used by this document.

dispose()

public void dispose()

Frees up memory

This method is obsolete, use close() instead.

fillUsedObjectsTable(System.Collections.Generic.Dictionary<Integer,Integer> usageTable, IPdfDictionary CommonResources)

public void fillUsedObjectsTable(System.Collections.Generic.Dictionary<Integer,Integer> usageTable, IPdfDictionary CommonResources)

Parameters:

ParameterTypeDescription
usageTablecom.aspose.ms.System.Collections.Generic.Dictionary<java.lang.Integer,java.lang.Integer>
CommonResourcesIPdfDictionary

deleteUnusedResources(System.Collections.Generic.Dictionary<Integer,Integer> usageTable)

public void deleteUnusedResources(System.Collections.Generic.Dictionary<Integer,Integer> usageTable)

Parameters:

ParameterTypeDescription
usageTablecom.aspose.ms.System.Collections.Generic.Dictionary<java.lang.Integer,java.lang.Integer>

clearContents()

public void clearContents()

For internal usage only

getArtifacts()

public ArtifactCollection getArtifacts()

Gets collection of artifacts on the page.

Returns: ArtifactCollection - ArtifactCollection value

getActions()

public PageActionCollection getActions()

Gets collection of page properties.

Returns: PageActionCollection - PageActionCollection value

makeGrayscale()

public final void makeGrayscale()

Converts the page to grayscale.

freeMemory()

public void freeMemory()

Clears cached data

getNotifications()

public String getNotifications()

Returns notifications about inside operations with page content. (Only notifications about paragraph events in text adding scenarios are supported now.)

Returns: java.lang.String - String representing notifications about inside operations with page content.

asByteArray(Resolution resolution)

public byte[] asByteArray(Resolution resolution)

Converts current page as BMP bitmap and than returns array of bytes.

Parameters:

ParameterTypeDescription
resolutionResolutionThe resolution.

Returns: byte[] - Converted array of image bytes.

asXml()

public String asXml()

Converts current page as xml in utf8 encoding.

Returns: java.lang.String - Converted xml string.

getFieldsInTabOrder()

public List<Field> getFieldsInTabOrder()

Gets list of Field object in Tab order on this page.

Returns: java.util.List<com.aspose.pdf.Field> - List of field objects

getUserUnit()

public final double getUserUnit()

Gets or sets UserUnit value. A positive number giving the size of default user space units, in multiples of 1 \u0432\u0403\u201e 72 inch. Default value is 1. Please set zero or negative value in order to clear this entry in page.

Returns: double - double value

setUserUnit(double value)

public final void setUserUnit(double value)

Gets or sets UserUnit value. A positive number giving the size of default user space units, in multiples of 1 \u0432\u0403\u201e 72 inch. Default value is 1. Please set zero or negative value in order to clear this entry in page.

Parameters:

ParameterTypeDescription
valuedoubledouble value