RemovePageRedaction

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

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()
 }
 

Constructors

Constructor Description
RemovePageRedaction(PageSeekOrigin origin, int index, int count) Initializes a new instance of RemovePageRedaction class.

Methods

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.

RemovePageRedaction(PageSeekOrigin origin, int index, int count)

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

getOrigin()

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.

getIndex()

public final int getIndex()

Gets start position index (0-based).

Returns: int - Start position index (0-based).

getCount()

public final int getCount()

Gets the count of pages to remove.

Returns: int - The count of pages to remove.

applyTo(DocumentFormatInstance formatInstance)

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