RasterizationOptions class

RasterizationOptions class

Provides options for converting files into PDF.

The RasterizationOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance.

Methods

Method Description
add_advanced_option Registers an advanced rasterization option to apply.
add_advanced_option Registers an advanced rasterization option to apply.

Properties

Property Description
compliance The PDF compliance level.
enabled The enabled flag indicates whether all pages in the document are converted to images and placed in a single PDF file. True by default; set to False to avoid rasterization.
has_advanced_options The indicator is True if advanced rasterization options are set.
page_count The number of pages to be converted into PDF.
page_index The zero‑based index of the first page to convert into PDF.

Example

from groupdocs.redaction import Redactor
from groupdocs.redaction.options import RasterizationOptions

# Load a document and save it as a rasterized PDF
with Redactor("./sample.docx") as redactor:
    ro = RasterizationOptions()
    ro.enabled = True  # convert pages to images and embed in PDF
    with open("./output.pdf", "wb") as out_stream:
        redactor.save(out_stream, ro)

See Also