Table of Contents

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

source Attachment

The batch.

outputDirectory string

The directory the documents are written to.

progress IProgress<PdfSplitterProgressEventArgs>

Told after each file, as PdfSplitter reports; its Cancel stops the run.

cancellationToken CancellationToken

Cancels the run between pages and documents.

Returns

BarcodeSplittingResult

Exceptions

ArgumentNullException

source or outputDirectory is null.

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

inputPath string

The batch file.

outputDirectory string

The directory the documents are written to.

password string

The password of an encrypted PDF.

progress IProgress<PdfSplitterProgressEventArgs>

Told after each file; its Cancel stops the run.

cancellationToken CancellationToken

Cancels the run between pages and documents.

Returns

BarcodeSplittingResult

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

data byte[]

The batch's bytes.

fileName string

The batch's name; its extension tells its type.

outputDirectory string

The directory the documents are written to.

password string

The password of an encrypted PDF.

progress IProgress<PdfSplitterProgressEventArgs>

Told after each file; its Cancel stops the run.

cancellationToken CancellationToken

Cancels the run between pages and documents.

Returns

BarcodeSplittingResult

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

stream Stream

The batch's stream; a stream that cannot seek is copied once.

fileName string

The batch's name; its extension tells its type.

outputDirectory string

The directory the documents are written to.

password string

The password of an encrypted PDF.

progress IProgress<PdfSplitterProgressEventArgs>

Told after each file; its Cancel stops the run.

cancellationToken CancellationToken

Cancels the run between pages and documents.

Returns

BarcodeSplittingResult
Share