# Page Class

> Represents a page within a PDF file.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2e
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Page
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/llms.txt

```java
class Page
```

**Namespace:** `com::datalogics::PDFL`

## Description

Represents a page within a PDF file. The page is the basic object used for organizing content in a PDF document.

**Referenced by:** [`Annotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Annotation.md), [`Bookmark`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Bookmark.md), [`CircleAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/CircleAnnotation.md), [`Content`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Content.md), [`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md), [`FreeTextAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/FreeTextAnnotation.md), [`HighlightAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/HighlightAnnotation.md), [`InkAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/InkAnnotation.md), [`LineAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/LineAnnotation.md), [`LinkAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/LinkAnnotation.md), [`PolyLineAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PolyLineAnnotation.md), [`PolygonAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PolygonAnnotation.md), [`Redaction`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Redaction.md), [`SeparationColorSpace`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationColorSpace.md), [`SquareAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SquareAnnotation.md), [`UnderlineAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/UnderlineAnnotation.md)

**Uses types:** [`Annotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Annotation.md), [`ColorConvertParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ColorConvertParams.md), [`Content`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Content.md), [`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md), [`DrawParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/DrawParams.md), [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Image.md), [`ImageCollection`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ImageCollection.md), [`Ink`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Ink.md), [`Matrix`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Matrix.md), [`OCREngine`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OCREngine.md), [`OptionalContentContext`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentContext.md), [`PDFDict`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PDFDict.md), [`PageImageParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PageImageParams.md), [`QREncodeParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/QREncodeParams.md), [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md), [`RenderProgressProc`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/RenderProgressProc.md), [`SeparationColorSpace`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationColorSpace.md), [`SeparationParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationParams.md)

## Constructors

### Page

```java
com.datalogics.PDFL.Page.Page(Document doc, int afterPageNum, Rect mediaBox)
```

*constructor*

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md)): The document in which the page is created.
- `afterPageNum` (`int`): The page number after which the new page is inserted. The first page is 0. Use PDBeforeFirstPage() (see PDExpT.h) to insert the new page at the beginning of a document.
- `mediaBox` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A rectangle specifying the page's media box, specified in user space coordinates.

Creates and acquires a new page. The page is inserted into the document at the specified location. Call PDPageRelease() when you are done using the page.

### Page

```java
com.datalogics.PDFL.Page.Page(Document doc, int pageNum)
```

*constructor*

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md)): The document containing the page to acquire.
- `pageNum` (`int`): The page number of the page to acquire. The first page is 0.

Gets a Page from a document.

## Methods

### addAnnotation

```java
void com.datalogics.PDFL.Page.addAnnotation(int addAfter, Annotation annot)
```

**Parameters**

- `addAfter` (`int`): The index into the page's annotation array where the annotation is added. The first annotation in the array has an index of zero. Passing a value of -2 adds the annotation to the end of the array. Passing other negative values produces undefined results.
- `annot` ([`Annotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Annotation.md)): The annotation to add.

**Returns:** `void`

(Deprecated, function may be removed in the future. Instead, use the constructor for Annotation or a subclass of Annotation.)

Adds an annotation at the specified location in a page's annotation array.

### addNewAnnotation

```java
Annotation com.datalogics.PDFL.Page.addNewAnnotation(int addAfter, String subType, Rect initialRect)
```

**Parameters**

- `addAfter` (`int`): Where to add the annotation in the page's annotation array. Passing a value of -2 adds the annotation to the end of the array (this is generally what you should do unless you have a need to place the annotation at a special location in the array). Passing a value of -1 adds the annotation to the beginning of the array. Passing other negative values produces undefined results.
- `subType` (`String`): The subtype of the annotation to add.
- `initialRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A pointer to a rectangle specifying the annotation's bounds, specified in user space coordinates.

**Returns:** [`Annotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Annotation.md)

The newly created annotation.

(Deprecated, function may be removed in the future. Instead, use the constructor for Annotation or a subclass of Annotation.)

Adds an annotation to the page. This method is equivalent to calling PDPageCreateAnnot() followed by PDPageAddAnnot().

### addQRBarcode

```java
boolean com.datalogics.PDFL.Page.addQRBarcode(QREncodeParams params)
```

**Parameters**

- `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/QREncodeParams.md)): The Params specified how to encode the barcode

**Returns:** `boolean`

if True, the Barcode was successfully added to the Page.

Add a QR Two-Dimensional Barcode encoded with the specified Params to the specified PDF page as an image.

### addQRBarcode

```java
void com.datalogics.PDFL.Page.addQRBarcode(String textToEncode, double x, double y, double width, double height)
```

**Parameters**

- `textToEncode` (`String`): The Text to be encoded in the barcode
- `x` (`double`): The horizontal location on the page in points
- `y` (`double`): The vertical location on the page in points
- `width` (`double`): The width of the barcode image in points
- `height` (`double`): The height of the barcode image in points

**Returns:** `void`

Add a QR Two-Dimensional Barcode encoded with the specified Text to the page as an image.

### colorConvertContent

```java
boolean com.datalogics.PDFL.Page.colorConvertContent(ColorConvertParams params)
```

**Parameters**

- `params` ([`ColorConvertParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ColorConvertParams.md)): The color conversion parameters.

**Returns:** `boolean`

True if color conversion occurred. False if nothing was color converted.

Convert the colors (in place) in a page as specified by the params block by applying an ICC profile to the objects contained in the page.

### createAnnotation

```java
Annotation com.datalogics.PDFL.Page.createAnnotation(String subType, Rect initialRect)
```

**Parameters**

- `subType` (`String`): The subtype of the annotation to add.
- `initialRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A pointer to a rectangle specifying the annotation's bounds, specified in user space coordinates.

**Returns:** [`Annotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Annotation.md)

The newly created annotation.

(Deprecated, function may be removed in the future. Instead, use the constructor for Annotation or a subclass of Annotation.)

Creates a new annotation, associated with the specified page's Document, but not added to the page. Use AddAnnotation to add the annotation to the page.

### delete

```java
synchronized void com.datalogics.PDFL.Page.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.Page.delete()
```

**Returns:** `synchronized void`

### drawContents

```java
byte[] com.datalogics.PDFL.Page.drawContents(DrawParams drawParams)
```

**Parameters**

- `drawParams` ([`DrawParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/DrawParams.md)): Parameters for the drawing operation

**Returns:** `byte[]`

an array of bytes containing the image.

Draw the contents of the page into a bitmap, and return the raw bitmap data as an array of bytes arranged in left to right, top to bottom order. Each row of the bitmap is aligned onto a four-byte boundary.

The amount of data returned depends on the destRect parameter. Using integer arithmetic:

stride = (width * components + 3) & ~3

array_size = stride * height

### drawContents

```java
java.util.List< java.awt.image.BufferedImage > com.datalogics.PDFL.Page.drawContents(DrawParams drawParams, java.util.List< SeparationColorSpace > colorants)
```

**Parameters**

- `drawParams` ([`DrawParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/DrawParams.md)): draw parameters for rendering of this page
- `colorants` ([`java.util.List< SeparationColorSpace >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationColorSpace.md)): collection of the page's colorants in SeparationColorSpace, that were constructed from an ink and a page. Their tint transforms and alternates will be ignored

**Returns:** `java.util.List< java.awt.image.BufferedImage >`

List, that contains buffered image for each ink

Draw the contents of this page in collection of the images. Each image in collection is a separated channel.

### drawContents

```java
void com.datalogics.PDFL.Page.drawContents(java.awt.image.BufferedImage image, Matrix matrix, Rect updateRect)
```

**Parameters**

- `image` (`java.awt.image.BufferedImage`): the image into which to rasterize the page.
- `matrix` ([`Matrix`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Matrix.md)): A matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling.
- `updateRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): the rectangle to draw, specified in user coordinates. Any objects outside the updateRect will not be drawn.

**Returns:** `void`

Draw the contents of this page to an image, only DeviceRGBA colorModel is supported.

### drawContents

```java
void com.datalogics.PDFL.Page.drawContents(java.awt.image.BufferedImage image, Matrix matrix, Rect updateRect, java.util.EnumSet< SmoothFlags > newAntiAlias, boolean doThinLine, boolean bypassCopyPerm)
```

**Parameters**

- `image` (`java.awt.image.BufferedImage`): the image into which to rasterize the page.
- `matrix` ([`Matrix`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Matrix.md)): A matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling.
- `updateRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): the rectangle to draw, specified in user coordinates. Any objects outside the updateRect will not be drawn.
- `newAntiAlias` (`java.util.EnumSet< SmoothFlags >`): antialias level.
- `doThinLine` (`boolean`): flag to set ThinLineHeuristics, to determine whether thin lines will be fattened non-linearly.
- `bypassCopyPerm` (`boolean`): flag to set to determine whether Copy Permissions are bypassed for drawing.

**Returns:** `void`

Draw the contents of this page to a BufferedImage, only DeviceRGBA colorModel is supported.

### drawContents

```java
void com.datalogics.PDFL.Page.drawContents(java.awt.image.BufferedImage image, Matrix matrix, Rect updateRect, java.util.EnumSet< SmoothFlags > newAntiAlias, boolean doThinLine, boolean bypassCopyPerm, OptionalContentContext optionalContentContext)
```

**Parameters**

- `image` (`java.awt.image.BufferedImage`): the image into which to rasterize the page.
- `matrix` ([`Matrix`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Matrix.md)): A matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling.
- `updateRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): the rectangle to draw, specified in user coordinates. Any objects outside the updateRect will not be drawn.
- `newAntiAlias` (`java.util.EnumSet< SmoothFlags >`): antialias level.
- `doThinLine` (`boolean`): flag to set ThinLineHeuristics, to determine whether thin lines will be fattened non-linearly.
- `bypassCopyPerm` (`boolean`): flag to set to determine whether Copy Permissions are bypassed for drawing.
- `optionalContentContext` ([`OptionalContentContext`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentContext.md)): the optional-content visibility state to render with. Passing null retains the current behavior (the document's default optional-content context).

**Returns:** `void`

Draw the contents of this page to a BufferedImage using a specific optional-content (layer) visibility state, only DeviceRGBA colorModel is supported.

### drawContents

```java
void com.datalogics.PDFL.Page.drawContents(java.awt.image.BufferedImage image, Matrix matrix, Rect updateRect, OptionalContentContext optionalContentContext)
```

**Parameters**

- `image` (`java.awt.image.BufferedImage`): the image into which to rasterize the page.
- `matrix` ([`Matrix`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Matrix.md)): A matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling.
- `updateRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): the rectangle to draw, specified in user coordinates. Any objects outside the updateRect will not be drawn.
- `optionalContentContext` ([`OptionalContentContext`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentContext.md)): the optional-content visibility state to render with. Passing null retains the current behavior (the document's default optional-content context).

**Returns:** `void`

Draw the contents of this page to an image using a specific optional-content (layer) visibility state, only DeviceRGBA colorModel is supported.

### finalize

```java
void com.datalogics.PDFL.Page.finalize()
```

*protected*

**Returns:** `void`

### flattenOptionalContent

```java
boolean com.datalogics.PDFL.Page.flattenOptionalContent()
```

**Returns:** `boolean`

true if the page was successfully flattened, false otherwise.

Flattens optional content on the page.

This page will be replaced with a version that has no optional content. The new version of the page will contain only what was visible on the page when the call was made.

The document's default optional content context will be used to determine visibility of optional content.

The optional content information formerly associated with content on the page will NOT be deleted from the document, as it is possible for optional content groups to contain items on multiple pages.

### flattenOptionalContent

```java
boolean com.datalogics.PDFL.Page.flattenOptionalContent(OptionalContentContext occ)
```

**Parameters**

- `occ` ([`OptionalContentContext`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentContext.md)): The optional content context in which content is checked for visibility.

**Returns:** `boolean`

true if the page was successfully flattened, false otherwise.

Flattens optional content on the page.

This page will be replaced with a version that has no optional content. The new version of the page will contain only what was visible on the page when the call was made.

The optional content information formerly associated with content on the page will NOT be deleted from the document, as it is possible for optional content groups to contain items on multiple pages.

### getAnnotation

```java
Annotation com.datalogics.PDFL.Page.getAnnotation(int annotIndex)
```

**Parameters**

- `annotIndex` (`int`): The index of the annotation to get on a page. The first annotation on a page has an index of zero.

**Returns:** [`Annotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Annotation.md)

The indexed annotation object.

Gets the annotIndex annotation on the page.

### getArtBox

```java
Rect com.datalogics.PDFL.Page.getArtBox()
```

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)

The ArtBox rectangle in user space coordinates.

Get the page's ArtBox.

The ArtBox defines the extent of the page's meaningful content (including potential white space) as intended by the page's creator.

### getBBox

```java
Rect com.datalogics.PDFL.Page.getBBox()
```

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)

The bounding box rectangle in user space coordinates.

Get the page's Bounding Box.

The BBox is the smallest rectangle that encloses all of the page's visible content. Unlike the other page boxes, it is calculated from the page content and cannot be set directly.

### getBleedBox

```java
Rect com.datalogics.PDFL.Page.getBleedBox()
```

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)

The BleedBox rectangle in user space coordinates.

Get the page's BleedBox.

The BleedBox defines the region to which the contents of the page shall be clipped when output in a production environment. It includes any extra bleed area needed to account for limitations of cutting, folding, and trimming equipment.

### getContent

```java
Content com.datalogics.PDFL.Page.getContent()
```

**Returns:** [`Content`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Content.md)

The content for the page.

Creates a Content from the Page object's contents and resources. The Content is cached, so that subsequent calls on the same Page return the same Content.

After making changes to the content, make sure to call the UpdateContent method on the Page.

### getCropBox

```java
Rect com.datalogics.PDFL.Page.getCropBox()
```

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)

The CropBox rectangle in user space coordinates.

Get the page's CropBox.

The CropBox defines the region to which the contents of the page are to be clipped (cropped) when displayed or printed. The default value is the page's MediaBox.

### getImage

```java
Image com.datalogics.PDFL.Page.getImage(Rect exportRect)
```

**Parameters**

- `exportRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A Rect describing the region of the page to export, specified in user space coordinates. One user unit corresponds to 1/72 inch. To export the entire page, set this parameter to the page's CropBox. User space coordinates correspond to the unrotated page; the rotation specified in Page.Rotation is not taken into account with these coordinates.

**Returns:** [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Image.md)

An Image containing the rendered page region.

Export a region of a PDF page to an Image object.

If the exportRect is smaller than the PDF page, then the pixel width and pixel height of the resulting image will be calculated from the exportRect and a resolution of 300.0, containing the area of the page inside the exportRect, scaled to fit. If a specific pixel size or resolution is desired, use the version of GetImage that takes a PageImageParams as a parameter.

### getImage

```java
Image com.datalogics.PDFL.Page.getImage(Rect exportRect, PageImageParams ImageParams)
```

**Parameters**

- `exportRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A Rect describing the region of the page to export, specified in user space coordinates. One user unit corresponds to 1/72 inch. To export the entire page, set this parameter to the page's CropBox. User space coordinates correspond to the unrotated page; the rotation specified in Page.Rotation is not taken into account with these coordinates.
- `ImageParams` ([`PageImageParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PageImageParams.md)): A PageImageParams containing additional parameters for the exported image, including the exported image's pixel width, pixel height, and resolution. If these parameters are not specified, the pixel width and pixel height of the image are calculated using the exportRect and a resolution of 300.0.

**Returns:** [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Image.md)

An Image containing the rendered page region.

Export a region of a PDF page to an Image object.

This version of GetImage can be used to specify a particular size in pixels for the exported image by setting ImageParams.PixelWidth and/or ImageParams.PixelHeight.

If the exportRect is smaller than the PDF page and ImageParams.PixelWidth and ImageParams.PixelHeight are set, then the resulting image will be of the size ImageParams.PixelWidth x ImageParams.PixelHeight and contain the area of the page inside the exportRect, scaled to fit.

It is also possible to use this function by specifying only ImageParams.PixelWidth or only ImageParams.PixelHeight. When only one is specified, the function will calculate the other.

### getImage

```java
Image com.datalogics.PDFL.Page.getImage(Rect exportRect, PageImageParams ImageParams, java.util.List< SeparationColorSpace > spaces)
```

**Parameters**

- `exportRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A Rect describing the region of the page to export, specified in user space coordinates. One user unit corresponds to 1/72 inch. To export the entire page, set this parameter to the page's CropBox. User space coordinates correspond to the unrotated page; the rotation specified in Page.Rotation is not taken into account with these coordinates.
- `ImageParams` ([`PageImageParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PageImageParams.md)): A PageImageParams containing additional parameters for the exported image, including the exported image's pixel width, pixel height, and resolution. If these parameters are not specified, the pixel width and pixel height of the image are calculated using the exportRect and a resolution of 300.0.
- `spaces` ([`java.util.List< SeparationColorSpace >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationColorSpace.md)): A collection of SeparationColorSpace objects. This parameter is used to specify page's inks to be drawn. Each SeparationColorSpace must be constructed from an ink and a page. Their tint transforms and alternates will be ignored.

**Returns:** [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Image.md)

An Image containing the rendered page region.

Export a region of a PDF page to an Image object.

This version of GetImage can be used to specify a particular size in pixels for the exported image by setting ImageParams.PixelWidth and/or ImageParams.PixelHeight.

It renders specified page's inks and ignores colorSpace parameter from ImageParams. This function always renders the page in DeviceN colorspace.

If the exportRect is smaller than the PDF page and ImageParams.PixelWidth and ImageParams.PixelHeight are set, then the resulting image will be of the size ImageParams.PixelWidth x ImageParams.PixelHeight and contain the area of the page inside the exportRect, scaled to fit.

It is also possible to use this function by specifying only ImageParams.PixelWidth or only ImageParams.PixelHeight. When only one is specified, the function will calculate the other.

### getImageSeparations

```java
ImageCollection com.datalogics.PDFL.Page.getImageSeparations(Rect exportRect, PageImageParams ImageParams, java.util.List< SeparationColorSpace > spaces, RenderProgressProc progressProc)
```

**Parameters**

- `exportRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A Rect describing the region of the page to export, specified in user space coordinates.
- `ImageParams` ([`PageImageParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PageImageParams.md)): A PageImageParams containing additional parameters for the exported image, including the exported image's pixel width, pixel height, and resolution.
- `spaces` ([`java.util.List< SeparationColorSpace >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationColorSpace.md)): A collection of SeparationColorSpace class additional parameter for specifying colorants for bitmap rendering.
- `progressProc` ([`RenderProgressProc`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/RenderProgressProc.md)): A callback to report rendering progress.

**Returns:** [`ImageCollection`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ImageCollection.md)

An ImageCollection containing one Image per separation colorant.

Export a region of a PDF page using the specified Separation ColorSpaces to an Image Collection object, with a progress callback.

### getImageSeparations

```java
ImageCollection com.datalogics.PDFL.Page.getImageSeparations(Rect exportRect, PageImageParams ImageParams, java.util.List< SeparationColorSpace > spacesCollection)
```

**Parameters**

- `exportRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A Rect describing the region of the page to export, specified in user space coordinates. One user unit corresponds to 1/72 inch. To export the entire page, set this parameter to the page's CropBox. User space coordinates correspond to the unrotated page; the rotation specified in Page.Rotation is not taken into account with these coordinates.
- `ImageParams` ([`PageImageParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PageImageParams.md)): A PageImageParams containing additional parameters for the exported image, including the exported image's pixel width, pixel height, and resolution. If these parameters are not specified, the pixel width and pixel height of the image are calculated using the exportRect and a resolution of 300.0.
- `spacesCollection` ([`java.util.List< SeparationColorSpace >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationColorSpace.md)): A collection of SeparationColorSpace class additional parameter for specifying colorants for bitmap rendering. Each SeparationColorSpace must be constructed from an ink and a page. Their tint transforms and alternates will be ignored.

**Returns:** [`ImageCollection`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ImageCollection.md)

An ImageCollection containing one Image per separation colorant.

Export a region of a PDF page using the specified Separation ColorSpaces to an Image Collection object.

This version of GetImage can be used to specify a particular size in pixels for the exported image by setting ImageParams.PixelWidth and/or ImageParams.PixelHeight.

If the exportRect is smaller than the PDF page and ImageParams.PixelWidth and ImageParams.PixelHeight are set, then the resulting image will be of the size ImageParams.PixelWidth x ImageParams.PixelHeight and contain the area of the page inside the exportRect, scaled to fit.

It is also possible to use this function by specifying only ImageParams.PixelWidth or only ImageParams.PixelHeight. When only one is specified, the function will calculate the other.

### getMediaBox

```java
Rect com.datalogics.PDFL.Page.getMediaBox()
```

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)

The MediaBox rectangle in user space coordinates.

Get the page's MediaBox.

The MediaBox defines the boundaries of the physical medium on which the page is intended to be displayed or printed. It is the largest of the page boxes and serves as the default for the CropBox.

### getNumAnnotations

```java
int com.datalogics.PDFL.Page.getNumAnnotations()
```

**Returns:** `int`

The number of annotations on this page.

Gets the number of annotations on a page. Annotations associated with pop-up windows (such as strikeouts) are counted as two annotations. Widget annotations (form fields) are included in the count.

### getOutputPreviewImage

```java
Image com.datalogics.PDFL.Page.getOutputPreviewImage(Rect exportRect, PageImageParams ImageParams, java.util.List< SeparationColorSpace > spaces)
```

**Parameters**

- `exportRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A Rect describing the region of the page to export, specified in user space coordinates. One user unit corresponds to 1/72 inch. To export the entire page, set this parameter to the page's CropBox. User space coordinates correspond to the unrotated page; the rotation specified in Page.Rotation is not taken into account with these coordinates.
- `ImageParams` ([`PageImageParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PageImageParams.md)): A PageImageParams containing additional parameters for the exported image, including the exported image's pixel width, pixel height, and resolution. If these parameters are not specified, the pixel width and pixel height of the image are calculated using the exportRect and a resolution of 300.0.
- `spaces` ([`java.util.List< SeparationColorSpace >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationColorSpace.md)): A collection of SeparationColorSpace class additional parameter for specifying colorants for bitmap rendering. Each SeparationColorSpace must be constructed from an ink and a page.

**Returns:** [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Image.md)

An Image representing the output preview of the page region.

Create an Output Preview image used when Soft Proofing a document prior to actual printing.

### getOutputPreviewImage

```java
Image com.datalogics.PDFL.Page.getOutputPreviewImage(Rect exportRect, PageImageParams ImageParams, java.util.List< SeparationColorSpace > spaces, boolean simulateOverprint)
```

**Parameters**

- `exportRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A Rect describing the region of the page to export, specified in user space coordinates. One user unit corresponds to 1/72 inch. To export the entire page, set this parameter to the page's CropBox. User space coordinates correspond to the unrotated page; the rotation specified in Page.Rotation is not taken into account with these coordinates.
- `ImageParams` ([`PageImageParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PageImageParams.md)): A PageImageParams containing additional parameters for the exported image, including the exported image's pixel width, pixel height, and resolution. If these parameters are not specified, the pixel width and pixel height of the image are calculated using the exportRect and a resolution of 300.0.
- `spaces` ([`java.util.List< SeparationColorSpace >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationColorSpace.md)): A collection of SeparationColorSpace class additional parameter for specifying colorants for bitmap rendering. Each SeparationColorSpace must be constructed from an ink and a page.
- `simulateOverprint` (`boolean`): A flag that controls if Overprint is simulated or not for Spot Colorants. NOTE: A file with Overprinting, Process, and Spot Colorants can yield a different appearance when Simulation is enabled compared to when it's not.

**Returns:** [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Image.md)

An Image representing the output preview of the page region.

Create an Output Preview image used when Soft Proofing a document prior to actual printing.

### getPDFDict

```java
PDFDict com.datalogics.PDFL.Page.getPDFDict()
```

**Returns:** [`PDFDict`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PDFDict.md)

Retrieve the PDFObject representation of this object.

### getPageNumber

```java
int com.datalogics.PDFL.Page.getPageNumber()
```

**Returns:** `int`

the number of this page in the Document.

Retrieve the page number for this PDF page.

Page numbers always start at zero.

### getRenderWarnings

```java
int com.datalogics.PDFL.Page.getRenderWarnings()
```

**Returns:** `int`

A bitfield to be compared against PageRenderWarning Enum values.

Reports possible page rendering problems.

### getRotation

```java
PageRotation com.datalogics.PDFL.Page.getRotation()
```

**Returns:** `PageRotation`

The number of degrees by which the page is rotated clockwise when displayed or printed.

### getTrimBox

```java
Rect com.datalogics.PDFL.Page.getTrimBox()
```

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)

The TrimBox rectangle in user space coordinates.

Get the page's TrimBox.

The TrimBox defines the intended dimensions of the finished page after trimming. It may be smaller than the MediaBox to account for production- related content such as printing instructions or cut marks.

### getUserUnit

```java
float com.datalogics.PDFL.Page.getUserUnit()
```

**Returns:** `float`

the size of default user space units.

Gets the size of default user space units for the page.

### hasTransparency

```java
boolean com.datalogics.PDFL.Page.hasTransparency(boolean includeAnnotAppearances)
```

**Parameters**

- `includeAnnotAppearances` (`boolean`): If true, annotation appearances are included in the check; if false, annotation appearances will be ignored.

**Returns:** `boolean`

true if the page uses transparency features, false otherwise.

Checks whether a page uses any transparency features.

Note: To determine whether a page uses transparency, the resources of the page must be enumerated (though the page contents do not need to be parsed). The page resources may not be optimized for slow (browser-based) connections, so calling Page.HasTransparency() before the page has been downloaded may cause unpleasant read behavior and performance problems.

### listInks

```java
java.util.List< Ink > com.datalogics.PDFL.Page.listInks()
```

**Returns:** [`java.util.List< Ink >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Ink.md)

A list of Ink objects representing the inks used on this page.

Retrieve a list of all inks present on a page.

### listInks

```java
java.util.List< Ink > com.datalogics.PDFL.Page.listInks(boolean includeOPI)
```

**Parameters**

- `includeOPI` (`boolean`): If true, include inks contained in OPI dictionaries.

**Returns:** [`java.util.List< Ink >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Ink.md)

A list of Ink objects representing the inks used on this page.

Retrieve a list of all inks present on a page.

### makeBufferedImage

```java
java.awt.image.BufferedImage com.datalogics.PDFL.Page.makeBufferedImage(Rect exportRect, PageImageParams pip)
```

**Parameters**

- `exportRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): A Rect describing the region of the page to export, specified in user space coordinates. One user unit corresponds to 1/72 inch. To export the entire page, set this parameter to the page's CropBox. User space coordinates correspond to the **unrotated** page; the rotation specified in Page.Rotation is not taken into account with these coordinates.
- `pip` ([`PageImageParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PageImageParams.md)): Additional parameters for the exported image, including the exported image's pixel width, pixel height, and resolution. If these parameters are not specified, the pixel width and height of the returned image are calculated using the exportRect and a resolution of 300.0.

**Returns:** `java.awt.image.BufferedImage`

Export a region of a PDF page to a java.awt.BufferedImage.

A particular size in pixels can be specified for the exported Bitmap by setting ImageParams.PixelWidth and/or ImageParams.PixelHeight.

If the exportRect is smaller than the PDF page and pip.PixelWidth and pip.PixelHeight are set, then the resulting image will be of the size pip.PixelWidth x pip.PixelHeight and contain the area of the page inside the exportRect, scaled to fit.

It is also possible to use this function by specifying only pip.PixelWidth or only pip.PixelHeight. When only one is specified, the function will calculate the other.

### makeSeparations

```java
void com.datalogics.PDFL.Page.makeSeparations(SeparationParams params)
```

**Parameters**

- `params` ([`SeparationParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/SeparationParams.md)): Parameters for the separation generation, including a list of plates.

**Returns:** `void`

Generate print color separations for a page.

### recognizePageContents

```java
void com.datalogics.PDFL.Page.recognizePageContents(Document doc, OCREngine engine)
```

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md)): The document the page being OCR'd belongs to
- `engine` ([`OCREngine`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OCREngine.md)): The OCR engine instance that will be used to OCR document

**Returns:** `void`

Run optical character recognition (OCR) on a page.

### removeAnnotation

```java
void com.datalogics.PDFL.Page.removeAnnotation(int annotIndex)
```

**Parameters**

- `annotIndex` (`int`): The index (into the page's annotation array) of the annotation to remove.

**Returns:** `void`

Removes an annotation from the specified page. Annotations are stored in arrays, which are automatically compressed when an annotation is removed. For this reason, if you use a loop in which you remove annotations, structure the code so the loop processes from the highest to the lowest index. If you loop the other direction, you will skip over annotations immediately following ones you remove.

### setArtBox

```java
void com.datalogics.PDFL.Page.setArtBox(Rect r)
```

**Parameters**

- `r` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): The rectangle specifying the ArtBox in user space coordinates, or null to remove the ArtBox.

**Returns:** `void`

Set the page's ArtBox.

The ArtBox defines the extent of the page's meaningful content (including potential white space) as intended by the page's creator.

### setBleedBox

```java
void com.datalogics.PDFL.Page.setBleedBox(Rect r)
```

**Parameters**

- `r` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): The rectangle specifying the BleedBox in user space coordinates, or null to remove the BleedBox.

**Returns:** `void`

Set the page's BleedBox.

The BleedBox defines the region to which the contents of the page shall be clipped when output in a production environment. It includes any extra bleed area needed to account for limitations of cutting, folding, and trimming equipment.

### setCropBox

```java
void com.datalogics.PDFL.Page.setCropBox(Rect r)
```

**Parameters**

- `r` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): The rectangle specifying the CropBox in user space coordinates, or null to remove the CropBox.

**Returns:** `void`

Set the page's CropBox.

The CropBox defines the region to which the contents of the page are to be clipped (cropped) when displayed or printed. The default value is the page's MediaBox.

### setMediaBox

```java
void com.datalogics.PDFL.Page.setMediaBox(Rect r)
```

**Parameters**

- `r` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): The rectangle specifying the MediaBox in user space coordinates.

**Returns:** `void`

Set the page's MediaBox.

The MediaBox defines the boundaries of the physical medium on which the page is intended to be displayed or printed. It is the largest of the page boxes and serves as the default for the CropBox.

### setRotation

```java
void com.datalogics.PDFL.Page.setRotation(PageRotation rotation)
```

**Parameters**

- `rotation` (`PageRotation`)

**Returns:** `void`

The number of degrees by which the page is rotated clockwise when displayed or printed.

### setTrimBox

```java
void com.datalogics.PDFL.Page.setTrimBox(Rect r)
```

**Parameters**

- `r` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): The rectangle specifying the TrimBox in user space coordinates, or null to remove the TrimBox.

**Returns:** `void`

Set the page's TrimBox.

The TrimBox defines the intended dimensions of the finished page after trimming. It may be smaller than the MediaBox to account for production- related content such as printing instructions or cut marks.

### setUserUnit

```java
void com.datalogics.PDFL.Page.setUserUnit(float userUnit)
```

**Parameters**

- `userUnit` (`float`): the size of default user space units.

**Returns:** `void`

Sets the size of default user space units for the page.

### updateContent

```java
void com.datalogics.PDFL.Page.updateContent()
```

**Returns:** `void`

Sets the page's Content back into the Page, using the same compression filters with which the content was previously encoded.

Call this function after making any changes to the Page's content.
