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
| Name | Type | Access | Description |
|---|---|---|---|
textReplaceOptions | TextReplaceOptions | Read | Returns the text replace options used by this editor. |
replaceTextStrategy | ReplaceTextStrategy | Read | Returns text-replacement strategy settings. |
document | Document | Read | Returns the bound document. |
Methods
| Signature | Description |
|---|---|
PdfContentEditor() | Creates a new {@code PdfContentEditor} instance. |
getTextReplaceOptions() → TextReplaceOptions | Returns the text replace options used by this editor. |
setTextReplaceOptions(options: TextReplaceOptions) | Sets the text replace options. |
getReplaceTextStrategy() → ReplaceTextStrategy | Returns text-replacement strategy settings. |
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. |
save(outputFile: String) → boolean | Saves the bound document to a file. |
save(outputStream: OutputStream) → boolean | Saves the bound document to an output stream. |
replaceText(searchText: String, replaceText: String) → boolean | Replaces all occurrences of the specified text throughout the entire document. |
replaceText(searchText: String, pageNumber: int, replaceText: String) → boolean | Replaces all occurrences of the specified text on a specific page. |
getDocument() → Document | Returns the bound document. |
getStamps(pageNumber: int) → StampInfo[] | Returns stamp metadata stored on a page. |
deleteStampById(pageNumber: int, stampId: int) → boolean | Deletes a stamp metadata entry by stamp id. |
deleteStampById(stampId: int) → boolean | Deletes 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) → boolean | Creates a {@link org.aspose.pdf.annotations.TextAnnotation} on |
| the given page at the given rectangle. | |
close() | Closes the editor and releases the bound document. |