PdfDocument.ExtractPages Method (Int32[])

Extracts pages with specified indexes into new PdfDocument.

Namespace:  BitMiracle.Docotic.Pdf
Assembly:  BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)

Syntax

C#
public PdfDocument ExtractPages(
	int[] indexes
)
VB
Public Function ExtractPages ( 
	indexes As Integer()
) As PdfDocument

Parameters

indexes
Type: System.Int32[]
The array of zero-based indexes of the pages to extract.

Return Value

Type: PdfDocument
A new PdfDocument that contains extracted pages.

Remarks

Extracted pages will be deleted from this PdfDocument.

If PdfDocument contains a single page then the PdfException will be thrown.

Use CopyPages() if you want to just copy pages from this PdfDocument.

Try RemoveUnusedResources() method on the new document. This method can reduce document size in cases when the extracted pages reference unused resources such as fonts, images, patterns.

See Also