RemovePageRedaction
Leave feedback
On this page
Inheritance: java.lang.Object, com.groupdocs.redaction.Redaction
public class RemovePageRedaction extends Redaction
Represents a redaction that removes a page (slide, worksheet, etc.) from a document.
Learn more
- More details about applying redactions: Redaction basics
- More details about removing pages: Remove page redaction
The following example demonstrates how to remove the last page of the document.
try (Redactor redactor = new Redactor("C:\\test.pdf"))
{
redactor.apply(new RemovePageRedaction(PageSeekOrigin.END, 0, 1));
redactor.save()
}
| Constructor | Description |
|---|---|
| RemovePageRedaction(PageSeekOrigin origin, int index, int count) | Initializes a new instance of RemovePageRedaction class. |
| Method | Description |
|---|---|
| getOrigin() | Gets seek reference position, the beginning or the end of a document. |
| getIndex() | Gets start position index (0-based). |
| getCount() | Gets the count of pages to remove. |
| applyTo(DocumentFormatInstance formatInstance) | Applies the redaction to a given format instance. |
public RemovePageRedaction(PageSeekOrigin origin, int index, int count)
Initializes a new instance of RemovePageRedaction class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| origin | PageSeekOrigin | Seek reference position, the beginning or the end of a document |
| index | int | Start position index (0-based) |
| count | int | Count of pages to remove |
public final PageSeekOrigin getOrigin()
Gets seek reference position, the beginning or the end of a document.
Returns: PageSeekOrigin - Seek reference position, the beginning or the end of a document.
public final int getIndex()
Gets start position index (0-based).
Returns: int - Start position index (0-based).
public final int getCount()
Gets the count of pages to remove.
Returns: int - The count of pages to remove.
public RedactorLogEntry applyTo(DocumentFormatInstance formatInstance)
Applies the redaction to a given format instance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| formatInstance | DocumentFormatInstance | An instance of a document to apply redaction |
Returns: RedactorLogEntry - Status of the redaction: success/failure and error message if any
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.