PdfDocument.ExtractPages Method (Int32, Int32, PdfConfigurationOptions)

Docotic.Pdf library help > BitMiracle.Docotic.Pdf > PdfDocument Class > PdfDocument Methods > ExtractPages Method > ExtractPages Method (Int32, Int32, PdfConfigurationOptions)
Extracts a range of pages into new PdfDocument using specified configuration options.

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

Syntax

C#
public PdfDocument ExtractPages(
	int index,
	int count,
	PdfConfigurationOptions options
)
VB
Public Function ExtractPages ( 
	index As Integer,
	count As Integer,
	options As PdfConfigurationOptions
) As PdfDocument

Parameters

index
Type: System.Int32
The zero-based starting index of the range of pages to extract.
count
Type: System.Int32
The number of pages to extract.
options
Type: BitMiracle.Docotic.Pdf.PdfConfigurationOptions
The configuration options.

Return Value

Type: PdfDocument
A new PdfDocument that contains extracted pages.

Remarks

Extracted pages will be deleted from this PdfDocument.

The new document will use the specified configuration options.

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