Table of Contents

Method ExtractPagesAsync

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

ExtractPagesAsync(string, string, string, CancellationToken)

Asynchronously extracts the specified pages from a PDF file and writes the result to an output file.

public static Task ExtractPagesAsync(string inputPath, string pageRange, string outputPath, CancellationToken cancellationToken = default)

Parameters

inputPath string

Path to the source PDF file.

pageRange string

A 1-based page range string (e.g., "1-5, 7, 9-12"). Null, empty, or "*" extracts all pages.

outputPath string

Path where the extracted PDF will be written.

cancellationToken CancellationToken

A token that can be used to cancel the operation.

Returns

Task

A task that represents the asynchronous extraction operation.

ExtractPagesAsync(string, int[], string, CancellationToken)

Asynchronously extracts the specified pages from a PDF file and writes the result to an output file.

public static Task ExtractPagesAsync(string inputPath, int[] pageIndexes, string outputPath, CancellationToken cancellationToken = default)

Parameters

inputPath string

Path to the source PDF file.

pageIndexes int[]

Zero-based page indexes to extract.

outputPath string

Path where the extracted PDF will be written.

cancellationToken CancellationToken

A token that can be used to cancel the operation.

Returns

Task

A task that represents the asynchronous extraction operation.

Share