PageRange constructor

PageRange(from_address, to)

Creates a new page range object.

def __init__(self, from_address: int, to: int):
    ...
ParameterTypeDescription
from_addressintThe starting page zero-based index.
tointThe ending page zero-based index. If it exceeds the index of the last page in the document, it is truncated to fit in the document on rendering.

Remarks

int.MaxValue C# constant means the last page in the document.

Examples

Shows how to extract pages based on exact page ranges.

doc = aw.Document(MY_DIR + "Images.docx")

image_options = aw.saving.ImageSaveOptions(aw.SaveFormat.TIFF)
ranges = [
    aw.saving.PageRange(1, 1),
    aw.saving.PageRange(2, 3),
    aw.saving.PageRange(1, 3),
    aw.saving.PageRange(2, 4),
    aw.saving.PageRange(1, 1)
    ]
page_set = aw.saving.PageSet(ranges=ranges)

image_options.page_set = page_set
doc.save(ARTIFACTS_DIR + "ImageSaveOptions.export_various_page_ranges.tiff", image_options)

See Also