PdfPageEditor

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

NameTypeAccessDescription
pageRotationsjava.util.Map<Integer, Integer>ReadReturns the rotations currently applied to every page.
processPagesint[]ReadReturns the array of page numbers that operations should affect.
pageCountintReadReturns the total number of pages in the bound document.
zoomfloatReadReturns the current zoom factor.

Methods

SignatureDescription
PdfPageEditor()Creates a new {@code PdfPageEditor} instance.
bindPdf(inputFile: String)booleanBinds a PDF file to this editor.
bindPdf(inputStream: InputStream)booleanBinds a PDF from an input stream.
bindPdf(document: Document)booleanBinds 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)intReturns 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()intReturns the total number of pages in the bound document.
getZoom()floatReturns 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)booleanSaves the bound document to a file.
save(outputStream: OutputStream)booleanSaves the bound document to an output stream.
close()Closes the editor and releases the bound document.

See Also