PdfPageEditor
Overview
PdfPageEditor is a class in Aspose.Pdf FOSS for Java.
Inherits from: java.io.Closeable.
Provides methods for editing individual page properties such as size, rotation, and retrieving page information.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
pageRotations | java.util.Map<Integer, Integer> | Read | Returns the rotations currently applied to every page. |
processPages | int[] | Read | Returns the array of page numbers that operations should affect. |
pageCount | int | Read | Returns the total number of pages in the bound document. |
zoom | float | Read | Returns the current zoom factor. |
Methods
| Signature | Description |
|---|---|
PdfPageEditor() | Creates a new {@code PdfPageEditor} instance. |
bindPdf(inputFile: String) → boolean | Binds a PDF file to this editor. |
bindPdf(inputStream: InputStream) → boolean | Binds a PDF from an input stream. |
bindPdf(document: Document) → boolean | Binds an existing {@link Document} to this editor. |
getPageSize(pageNumber: int) → float[] | Returns the size of the specified page as a float array {@code [width, height]}. |
setPageSize(pageNumber: int, size: PageSize) | Sets the size of the specified page. |
getPageRotation(pageNumber: int) → int | Returns the rotation of the specified page in degrees. |
setPageRotation(pageNumber: int, rotation: int) | Sets the rotation of the specified page. |
setPageRotations(rotations: java.util.Map<Integer, Integer>) | Bulk-applies rotations from a {@code pageNumber → degrees} map. |
getPageRotations() → java.util.Map<Integer, Integer> | Returns the rotations currently applied to every page. |
getProcessPages() → int[] | Returns the array of page numbers that operations should affect. |
setProcessPages(processPages: int[]) | Sets the array of page numbers that operations should affect. |
getPageCount() → int | Returns the total number of pages in the bound document. |
getZoom() → float | Returns the current zoom factor. |
setZoom(zoom: float) | Sets a zoom factor applied to all (or processed) pages when |
| {@link #save(String)} or {@link #save(OutputStream)} is called. | |
movePosition(dx: int, dy: int) | Translates page contents by {@code (dx, dy)} units when the document is |
| saved. | |
save(outputFile: String) → boolean | Saves the bound document to a file. |
save(outputStream: OutputStream) → boolean | Saves the bound document to an output stream. |
close() | Closes the editor and releases the bound document. |