PdfContentEditor

PdfContentEditor

Overview

PdfContentEditor is a class in Aspose.Pdf FOSS for Java. Inherits from: AutoCloseable.

Provides methods for editing PDF content, primarily text replacement operations.

Properties

NameTypeAccessDescription
textReplaceOptionsTextReplaceOptionsReadReturns the text replace options used by this editor.
replaceTextStrategyReplaceTextStrategyReadReturns text-replacement strategy settings.
documentDocumentReadReturns the bound document.

Methods

SignatureDescription
PdfContentEditor()Creates a new {@code PdfContentEditor} instance.
getTextReplaceOptions()TextReplaceOptionsReturns the text replace options used by this editor.
setTextReplaceOptions(options: TextReplaceOptions)Sets the text replace options.
getReplaceTextStrategy()ReplaceTextStrategyReturns text-replacement strategy settings.
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.
save(outputFile: String)booleanSaves the bound document to a file.
save(outputStream: OutputStream)booleanSaves the bound document to an output stream.
replaceText(searchText: String, replaceText: String)booleanReplaces all occurrences of the specified text throughout the entire document.
replaceText(searchText: String, pageNumber: int, replaceText: String)booleanReplaces all occurrences of the specified text on a specific page.
getDocument()DocumentReturns the bound document.
getStamps(pageNumber: int)StampInfo[]Returns stamp metadata stored on a page.
deleteStampById(pageNumber: int, stampId: int)booleanDeletes a stamp metadata entry by stamp id.
deleteStampById(stampId: int)booleanDeletes stamp metadata entries by stamp id from all pages.
createText(rect: org.aspose.pdf.Rectangle, title: String, contents: String, open: boolean, icon: String, pageNumber: int)booleanCreates a {@link org.aspose.pdf.annotations.TextAnnotation} on
the given page at the given rectangle.
close()Closes the editor and releases the bound document.

See Also