Method SavePagesAsMultipageTiffBytesAsync
SavePagesAsMultipageTiffBytesAsync(string, PdfRenderOptions, IProgress<PdfRenderProgressEventArgs>, CancellationToken)
Renders the selected pages and returns them as a multi-page TIFF byte array.
public static Task<byte[]> SavePagesAsMultipageTiffBytesAsync(string inputPath, PdfRenderOptions options = null, IProgress<PdfRenderProgressEventArgs> progress = null, CancellationToken cancellationToken = default)
Parameters
inputPathstringPath to the source PDF.
optionsPdfRenderOptionsRender options.
progressIProgress<PdfRenderProgressEventArgs>Optional progress callback fired after each rendered page.
cancellationTokenCancellationTokenCancels the operation between pages.
Returns
Examples
using LMKit.Document.Pdf;
byte[] tiff = PdfRenderer.SavePagesAsMultipageTiffBytes("scan.pdf");
// Upload tiff to S3, attach to email, etc.
Remarks
Internally writes to a temporary file then reads the bytes, because the native multi-page TIFF writer only targets a file path.