Method SplitToFiles
- Namespace
- LMKit.Extraction.Barcodes
- Assembly
- LM-Kit.NET.dll
SplitToFiles(Attachment, string, IProgress<PdfSplitterProgressEventArgs>, CancellationToken)
Splits a batch into files in outputDirectory (created when missing),
named by FileNameTemplate, existing files handled
by FileConflict. Two documents of one run never
share a file.
public BarcodeSplittingResult SplitToFiles(Attachment source, string outputDirectory, IProgress<PdfSplitterProgressEventArgs> progress = null, CancellationToken cancellationToken = default)
Parameters
sourceAttachmentThe batch.
outputDirectorystringThe directory the documents are written to.
progressIProgress<PdfSplitterProgressEventArgs>Told after each file, as PdfSplitter reports; its
Cancelstops the run.cancellationTokenCancellationTokenCancels the run between pages and documents.
Returns
Exceptions
- ArgumentNullException
sourceoroutputDirectoryisnull.- IOException
A file exists and FileConflict is Throw.
SplitToFiles(string, string, string, IProgress<PdfSplitterProgressEventArgs>, CancellationToken)
Splits a batch file into files in outputDirectory.
public BarcodeSplittingResult SplitToFiles(string inputPath, string outputDirectory, string password = "", IProgress<PdfSplitterProgressEventArgs> progress = null, CancellationToken cancellationToken = default)
Parameters
inputPathstringThe batch file.
outputDirectorystringThe directory the documents are written to.
passwordstringThe password of an encrypted PDF.
progressIProgress<PdfSplitterProgressEventArgs>Told after each file; its
Cancelstops the run.cancellationTokenCancellationTokenCancels the run between pages and documents.
Returns
SplitToFiles(byte[], string, string, string, IProgress<PdfSplitterProgressEventArgs>, CancellationToken)
Splits a batch held in memory into files in outputDirectory.
public BarcodeSplittingResult SplitToFiles(byte[] data, string fileName, string outputDirectory, string password = "", IProgress<PdfSplitterProgressEventArgs> progress = null, CancellationToken cancellationToken = default)
Parameters
databyte[]The batch's bytes.
fileNamestringThe batch's name; its extension tells its type.
outputDirectorystringThe directory the documents are written to.
passwordstringThe password of an encrypted PDF.
progressIProgress<PdfSplitterProgressEventArgs>Told after each file; its
Cancelstops the run.cancellationTokenCancellationTokenCancels the run between pages and documents.
Returns
SplitToFiles(Stream, string, string, string, IProgress<PdfSplitterProgressEventArgs>, CancellationToken)
Splits a batch read from a stream (left open) into files in outputDirectory.
public BarcodeSplittingResult SplitToFiles(Stream stream, string fileName, string outputDirectory, string password = "", IProgress<PdfSplitterProgressEventArgs> progress = null, CancellationToken cancellationToken = default)
Parameters
streamStreamThe batch's stream; a stream that cannot seek is copied once.
fileNamestringThe batch's name; its extension tells its type.
outputDirectorystringThe directory the documents are written to.
passwordstringThe password of an encrypted PDF.
progressIProgress<PdfSplitterProgressEventArgs>Told after each file; its
Cancelstops the run.cancellationTokenCancellationTokenCancels the run between pages and documents.