GetBarcodes

GetBarcodes()

Extracts barcodes from the document.

public IEnumerable<PageBarcodeArea> GetBarcodes()

Return Value

A collection of PageBarcodeArea objects; null if barcodes extraction isn’t supported.

Examples

The following example shows how to extract barcodes from a document:

// Create an instance of Parser class
using (Parser parser = new Parser(filePath))
{
    // Extract barcodes from the document.
    IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes();

    // Iterate over barcodes
    foreach(PageBarcodeArea barcode in barcodes)
    {
        // Print the page index
        Console.WriteLine("Page: " + barcode.Page.Index.ToString());
        // Print the barcode value
        Console.WriteLine("Value: " + barcode.Value);
    }
}

See Also


GetBarcodes(int)

Extracts barcodes from the document page.

public IEnumerable<PageBarcodeArea> GetBarcodes(int pageIndex)
Parameter Type Description
pageIndex Int32 The zero-based page index.

Return Value

A collection of PageBarcodeArea objects; null if barcodes extraction isn’t supported.

Examples

The following example shows how to extract barcodes from a document page:

// Create an instance of Parser class
using (Parser parser = new Parser(filePath))
{
    // Extract barcodes from the second document page.
    IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes(1);

    // Iterate over barcodes
    foreach(PageBarcodeArea barcode in barcodes)
    {
        // Print the page index
        Console.WriteLine("Page: " + barcode.Page.Index.ToString());
        // Print the barcode value
        Console.WriteLine("Value: " + barcode.Value);
    }
}

See Also


GetBarcodes(PageAreaOptions)

Extracts barcodes from the document using customization options (to set the rectangular area that contains barcodes).

public IEnumerable<PageBarcodeArea> GetBarcodes(PageAreaOptions options)
Parameter Type Description
options PageAreaOptions The options for barcodes extraction.

Return Value

A collection of PageBarcodeArea objects; null if barcodes extraction isn’t supported.

Examples

The following example shows how to extract barcodes from the upper-right corner.

// Create an instance of Parser class
using (Parser parser = new Parser(filePath))
{
    // Create the options which are used for barcodes extraction
    PageAreaOptions options = new PageAreaOptions(new Rectangle(new Point(590, 80), new Size(150, 150)));
    // Extract barcodes from the upper-right corner.
    IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes(options);

    // Iterate over barcodes
    foreach (PageBarcodeArea barcode in barcodes)
    {
        // Print the page index
        Console.WriteLine("Page: " + barcode.Page.Index.ToString());
        // Print the barcode value
        Console.WriteLine("Value: " + barcode.Value);
    }
}

See Also


GetBarcodes(int, PageAreaOptions)

Extracts barcodes from the document page using customization options (to set the rectangular area that contains barcodes).

public IEnumerable<PageBarcodeArea> GetBarcodes(int pageIndex, PageAreaOptions options)
Parameter Type Description
pageIndex Int32 The zero-based page index.
options PageAreaOptions The options for barcodes extraction.

Return Value

A collection of PageBarcodeArea objects; null if barcodes extraction isn’t supported.

See Also