Table of Contents

Interface IPdfSaveService

Namespace
PdfEngine.Save
Assembly
PdfEngine.Abstractions.dll

Saves documents and exports pages as image files.

public interface IPdfSaveService

Methods

ExportPagesToImagesAsync(IPdfDocument, string, string, int, int, string, int, IProgress<double>?, CancellationToken)

Renders a range of pages and writes each one as an image file.

ValueTask ExportPagesToImagesAsync(IPdfDocument document, string outputDirectory, string filePrefix, int startPage, int endPage, string format = "png", int dpi = 300, IProgress<double>? progress = null, CancellationToken cancellationToken = default)

Parameters

document IPdfDocument

An open document of this engine.

outputDirectory string

The folder for the image files.

filePrefix string

The start of each file name.

startPage int

The first page, starting at 1.

endPage int

The last page (included).

format string

The image format, for example "png" or "jpg".

dpi int

The resolution of the images.

progress IProgress<double>

Receives the fraction done, from 0 to 1.

cancellationToken CancellationToken

Cancels the operation.

Returns

ValueTask

SaveAsync(IPdfDocument, string, SaveOptions?, CancellationToken)

Saves document to targetPath.

ValueTask SaveAsync(IPdfDocument document, string targetPath, SaveOptions? options = null, CancellationToken cancellationToken = default)

Parameters

document IPdfDocument

An open document of this engine.

targetPath string

The file to write.

options SaveOptions

How to write the file; null uses the defaults.

cancellationToken CancellationToken

Cancels the operation.

Returns

ValueTask