Pages collection object

The Pages collection object implements the IPages interface. This interface defines methods to add, import, move or delete pages as well to access individual Page items.

It is accessed via the PDF object.

IPages methods

Name

Return type

Description

Count()

LONG

Returns the number of items in the Pages collection, in other words the number of pages in the PDF.

Delete()

 

Deletes a page from the PDF.

ExtractTo(destFilename, srcIndex, srcCount, optimize)

 

Extracts pages from the PDF and creates a new file with these pages.

Insert(index, *mediaSize)

 

Inserts a new blank page in the PDF file.

InsertFrom(srcFilename, srcIndex, srcCount, destIndex)

 

Inserts pages from another PDF file into this one. All relevant resources are copied with the pages.

InsertFrom2(srcPages, srcIndex, srcCount, destIndex)

 

Inserts pages from another IPages object into this one. All relevant resources are copied with the pages.

Item(index)

IPage (see Page object)

Returns a Page object from the PDF. Note that sinceItem() is the collection's default method, it can be omitted altogether (e.g. IPages(0) is the same as IPages.Item(0)).

Move(index, count, offset)

 

Moves a range of pages within the same PDF.