Table of Contents

Method ExtractPages

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

ExtractPages(int[])

Extracts pages with specified indexes into new PdfDocument.

public PdfDocument ExtractPages(int[] indexes)

Parameters

indexes int[]

The array of zero-based indexes of the pages to extract.

Returns

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.

You can use this method to split PDF documents. Check the Split PDF documents in C# and VB.NET article to see the other ways to do the same.

ExtractPages(PdfPage[])

Extracts specified pages into new PdfDocument.

public PdfDocument ExtractPages(PdfPage[] pages)

Parameters

pages PdfPage[]

The array of pages to extract.

Returns

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.

You can use this method to split PDF documents. Check the Split PDF documents in C# and VB.NET article to see the other ways to do the same.

ExtractPages(int, int)

Extracts a range of pages into new PdfDocument.

public PdfDocument ExtractPages(int index, int count)

Parameters

index int

The zero-based starting index of the range of pages to extract.

count int

The number of pages to extract.

Returns

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.

You can use this method to split PDF documents. Check the Split PDF documents in C# and VB.NET article to see the other ways to do the same.

ExtractPages(int, int, PdfConfigurationOptions)

Extracts a range of pages into new PdfDocument using specified configuration options.

public PdfDocument ExtractPages(int index, int count, PdfConfigurationOptions options)

Parameters

index int

The zero-based starting index of the range of pages to extract.

count int

The number of pages to extract.

options PdfConfigurationOptions

The configuration options.

Returns

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.

You can use this method to split PDF documents. Check the Split PDF documents in C# and VB.NET article to see the other ways to do the same.

Read the Font loading in cloud environments section for an example of using configuration options.