Interface IPdfSaveService
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
documentIPdfDocumentAn open document of this engine.
outputDirectorystringThe folder for the image files.
filePrefixstringThe start of each file name.
startPageintThe first page, starting at 1.
endPageintThe last page (included).
formatstringThe image format, for example "png" or "jpg".
dpiintThe resolution of the images.
progressIProgress<double>Receives the fraction done, from 0 to 1.
cancellationTokenCancellationTokenCancels the operation.
Returns
SaveAsync(IPdfDocument, string, SaveOptions?, CancellationToken)
Saves document to targetPath.
ValueTask SaveAsync(IPdfDocument document, string targetPath, SaveOptions? options = null, CancellationToken cancellationToken = default)
Parameters
documentIPdfDocumentAn open document of this engine.
targetPathstringThe file to write.
optionsSaveOptionsHow to write the file; null uses the defaults.
cancellationTokenCancellationTokenCancels the operation.