Method SavePagesAsTiffsAsync
SavePagesAsTiffsAsync(string, string, PdfRenderOptions, string, IProgress<PdfRenderProgressEventArgs>, CancellationToken)
Renders the selected pages and writes one single-page TIFF per page.
public static Task<IReadOnlyList<string>> SavePagesAsTiffsAsync(string inputPath, string outputDirectory, PdfRenderOptions options = null, string fileNamePrefix = "page", IProgress<PdfRenderProgressEventArgs> progress = null, CancellationToken cancellationToken = default)
Parameters
inputPathstringPath to the source PDF.
outputDirectorystringFolder to write the per-page output files into. Created if missing.
optionsPdfRenderOptionsRender options.
fileNamePrefixstringPrefix for each output filename. Files are named
{prefix}-{1-based page}.tif.progressIProgress<PdfRenderProgressEventArgs>Optional progress callback fired after each saved page.
cancellationTokenCancellationTokenCancels the operation between pages.
Returns
Examples
using LMKit.Document.Pdf;
using LMKit.Media.Image;
// Archival grayscale TIFFs at 300 DPI, one file per page
PdfRenderOptions options = new()
{
Zoom = 300.0 / 72.0,
PixelFormat = ImagePixelFormat.GRAY8,
};
IReadOnlyList<string> files = PdfRenderer.SavePagesAsTiffs(
"scan.pdf", outputDirectory: "archive", options);
Remarks
To pack all pages into a single multi-page TIFF file, use SavePagesAsMultipageTiff(string, string, PdfRenderOptions, IProgress<PdfRenderProgressEventArgs>, CancellationToken) instead.