RemovePageRedaction class

RemovePageRedaction class

Represents a redaction that removes a page (slide, worksheet, etc.) from a document.

Learn more

The RemovePageRedaction type exposes the following members:

Constructors

Constructor Description
init Initializes a new RemovePageRedaction.

Methods

Method Description
apply_to Applies the redaction to a given format instance.
apply_to_document_format_instance

Properties

Property Description
count The count of pages to remove.
index The start position index (0-based).
origin The seek reference position, either the beginning or the end of a document.
description The description of the redaction, containing its name and parameters. (inherited from Redaction)

Example

from groupdocs.redaction import Redactor
from groupdocs.redaction.options import SaveOptions
from groupdocs.redaction.redactions import RemovePageRedaction, PageSeekOrigin

def remove_last_page():
    # Remove 1 page counting from the end of the document
    rem_opt = RemovePageRedaction(PageSeekOrigin.END, 0, 1)

    with Redactor("./test.pdf") as redactor:
        # Apply the redaction
        result = redactor.apply(rem_opt)

        # Save the redacted document
        so = SaveOptions()
        so.add_suffix = True
        redactor.save(so)

Guides

Task guides that use RemovePageRedaction:

See Also