PageCollection

PageCollection

Overview

PageCollection is a class in Aspose.PDF FOSS for Python.

A collection to manage PDF pages within a Document.

This class provides 10 methods for working with PageCollection objects in Python programs. Available methods include: Delete, __init__, add, clear, contains, delete, get_enumerator, index_of, insert, item. All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.

Methods

SignatureDescription
__init__(document: Document)Create a new collection.
item(index: int)PageLegacy accessor mirroring the original Item method.
get_enumerator()Iterator[Page]Legacy iterator name - returns an iterator over the pages.
add(page: Page | Any | None)PageAppend a page to the collection.
insert(index: int, page: Page | Any | None)PageInsert a page at index.
delete(index: int)Delete the page at index.
Delete(index: int)Public API alias for :meth:delete.
clear()Remove all pages from the collection.
contains(page: Page)boolReturn True if page is present in the collection.
index_of(page: Page)intReturn the zero-based index of page in the collection.

See Also