Method SplitToFilesAsync
SplitToFilesAsync(Attachment, IEnumerable<string>, string, string, CancellationToken)
Asynchronously splits a PDF attachment into multiple files based on the provided page ranges.
public static Task<List<string>> SplitToFilesAsync(Attachment source, IEnumerable<string> pageRanges, string outputDirectory, string fileNamePrefix = null, CancellationToken cancellationToken = default)
Parameters
sourceAttachmentThe source PDF attachment.
pageRangesIEnumerable<string>A collection of 1-based page range strings.
outputDirectorystringDirectory where the output files will be written.
fileNamePrefixstringOptional prefix for output file names.
cancellationTokenCancellationTokenA token that can be used to cancel the operation.
Returns
SplitToFilesAsync(Attachment, DocumentSplittingResult, string, string, CancellationToken)
Asynchronously splits a PDF attachment into multiple files based on detected DocumentSplittingResult segments.
public static Task<List<string>> SplitToFilesAsync(Attachment source, DocumentSplittingResult splittingResult, string outputDirectory, string fileNamePrefix = null, CancellationToken cancellationToken = default)
Parameters
sourceAttachmentThe source PDF attachment.
splittingResultDocumentSplittingResultThe detected document segments.
outputDirectorystringDirectory where the output files will be written.
fileNamePrefixstringOptional prefix for output file names.
cancellationTokenCancellationTokenA token that can be used to cancel the operation.
Returns
SplitToFilesAsync(string, IEnumerable<string>, string, string, CancellationToken)
Asynchronously splits a PDF file into multiple files based on the provided page ranges.
public static Task<List<string>> SplitToFilesAsync(string inputPath, IEnumerable<string> pageRanges, string outputDirectory, string fileNamePrefix = null, CancellationToken cancellationToken = default)
Parameters
inputPathstringPath to the source PDF file.
pageRangesIEnumerable<string>A collection of 1-based page range strings.
outputDirectorystringDirectory where the output files will be written.
fileNamePrefixstringOptional prefix for output file names.
cancellationTokenCancellationTokenA token that can be used to cancel the operation.