Class BarcodeSplittingOptions
- Namespace
- LMKit.Extraction.Barcodes
- Assembly
- LM-Kit.NET.dll
How BarcodeSplitting reads a batch: what a barcode means, which barcodes count, how pages are cleaned up, how pages are scanned and how documents are written.
public sealed class BarcodeSplittingOptions
- Inheritance
-
BarcodeSplittingOptions
- Inherited Members
Examples
Example: duplex batch with QR separator sheets, files named after the next document's code
using LMKit.Extraction.Barcodes;
var options = new BarcodeSplittingOptions
{
Mode = BarcodeSplitMode.SeparatorPage,
SeparatorHandling = SeparatorPageHandling.Remove,
RemoveBlankPageAfterSeparator = true,
Match = new BarcodeMatchRule { Formats = new[] { BarcodeFormat.QRCode }, Pattern = @"^DOC-" },
FileNameTemplate = "{value}"
};
BarcodeSplittingResult result = new BarcodeSplitting(options).SplitToFiles("batch.pdf", "out");
Properties
- BlankTolerance
Gets or sets the per-channel noise tolerance (0 to 255) under which a light, uniform page counts as blank; the meaning of DetectBlankPages(Attachment, byte, CancellationToken). Default: 10 (scanner noise); use 0 for born-digital files.
- FileConflict
Gets or sets what happens when an output file already exists. Default: MakeUnique.
- FileNameTemplate
Gets or sets how output files and documents are named, without extension. Tokens:
{source}(the source's name),{index}(1-based document number,{index:000}pads it),{value}(the document's value, or its label when it has none),{start}and{end}(first and last page numbers),{pages}(page count) and{format}(the barcode format). Characters a file name cannot hold are replaced. Default:"{source}_{index:000}".
- LeadingPages
Gets or sets what becomes of the pages no barcode accounts for. Default: KeepAsDocument.
- Match
Gets or sets which barcodes count.
- MaxDegreeOfParallelism
Gets or sets how many pages are decoded at once. Default: the processor count.
- Mode
Gets or sets what a matching barcode means. Default: SeparatorPage.
- OutputDpi
Gets or sets the resolution PDF pages are rendered at when written as TIFF, or when an image document is written as PDF without a resolution of its own. Default: 300.
- OutputFormat
Gets or sets the format of the documents written. Default: Pdf.
- PagesToScan
Gets or sets the pages scanned for barcodes, as a 1-based page range ("1-10, 15");
null(the default) scans every page. Pages left out are never separators or markers, are never removed as blank, and stay in the documents as content.
- Reader
Gets or sets how the barcode reader searches each page. Its formats are narrowed to Formats when the rule names some.
- RemoveBlankPageAfterSeparator
Gets or sets whether a blank page right after a removed separator page is removed too: the back of a separator sheet in a duplex scan. Default:
false.
- RemoveBlankPages
Gets or sets whether every blank page is removed from the documents. Default:
false.
- RenderDpi
Gets or sets the resolution PDF and other vector pages are rendered at to be scanned. Image pages are scanned at their own resolution. Default: 200; 150 is often enough for large codes, 300 helps small or dense ones.
- SeparatorHandling
Gets or sets what becomes of a separator page (SeparatorPage mode only). Default: Remove.
- SkipEmptyDocuments
Gets or sets whether documents left without a page (two separators in a row) are left out of the result. Default:
true.
- ValuePattern
Gets or sets a regular expression that extracts a document's value from its barcode text: the group named
valuewhen the pattern has one, else the whole match. A text the pattern does not match keeps its full text.null(the default) uses the full text. The value labels the document, names its file ({value}) and is the key of ValueChange and GroupByValue.
- ValueSelector
Gets or sets a function that computes a document's value from its barcode; it takes precedence over ValuePattern.
Methods
- Clone()
Returns a copy of these options.