public class PageInfo
extends java.lang.Object
To learn more, visit the Rendering documentation article.
Remarks:
The page width and height returned by this object represent the "final" size of the page e.g. they are already rotated to the correct orientation.
Document.getPageInfo(int)| Modifier and Type | Method and Description |
|---|---|
boolean |
getColored()
Returns
true if the page contains colored content. |
float |
getHeightInPoints()
Gets the height of the page in points.
|
boolean |
getLandscape()
Returns
true if the page orientation specified in the document for this page is landscape. |
int |
getPaperSize()
Gets the paper size as enumeration.
|
int |
getPaperTray()
Gets the paper tray (bin) for this page as specified in the document.
|
java.awt.Dimension |
getSizeInPixels(float scale,
float dpi)
Calculates the page size in pixels for a specified zoom factor and resolution.
|
java.awt.Dimension |
getSizeInPixels(float scale,
float horizontalDpi,
float verticalDpi)
Calculates the page size in pixels for a specified zoom factor and resolution.
|
java.awt.geom.Point2D.Float |
getSizeInPoints()
Gets the page size in points.
|
float |
getWidthInPoints()
Gets the width of the page in points.
|
public java.awt.Dimension getSizeInPixels(float scale,
float dpi)
scale - The zoom factor (1.0 is 100%).dpi - The resolution (horizontal and vertical) to convert from points to pixels (dots per inch).public java.awt.Dimension getSizeInPixels(float scale,
float horizontalDpi,
float verticalDpi)
scale - The zoom factor (1.0 is 100%).horizontalDpi - The horizontal resolution to convert from points to pixels (dots per inch).verticalDpi - The vertical resolution to convert from points to pixels (dots per inch).public int getPaperSize()
PaperSize constants.public float getWidthInPoints()
public float getHeightInPoints()
public java.awt.geom.Point2D.Float getSizeInPoints()
public int getPaperTray()
public boolean getLandscape()
true if the page orientation specified in the document for this page is landscape.true if the page orientation specified in the document for this page is landscape.public boolean getColored()
throws java.lang.Exception
true if the page contains colored content.
Examples:
Shows how to check whether the page is in color or not.
Document doc = new Document(getMyDir() + "Document.docx");
// Check that the first page of the document is not colored.
Assert.assertFalse(doc.getPageInfo(0).getColored());
true if the page contains colored content.java.lang.Exception