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 instance of RemovePageRedaction.

Methods

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

Properties

Property Description
count The number 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, describing the redaction and its parameters. (inherited from Redaction)

Example

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

# Remove the last page of a 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 next to the source file
    so = SaveOptions()
    so.add_suffix = True
    so.rasterize_to_pdf = False
    so.redacted_file_suffix = "redacted"
    redactor.save(so)

Guides

Task guides that use RemovePageRedaction:

See Also