Barcode::DataMatrix::PNG(3pm)

Barcode::DataMatrix::PNG3pm

Generate png graphical representations of data matrix barcodes

Usage

    use Barcode::DataMatrix::PNG;
    my $data = Barcode::DataMatrix::PNG->new->(barcode=>'test_barcode');
                                                                                        # Minimal call for a new object.
        $data->encode();                                                # Encode the Barcode data.
        $data->render();                                                # Default:  Render the image to <STDOUT>
        $data->target = 'pass';                                 # C<return()> the image.
        my $barcode = $data->render();                  # Return a PNG representation of a DataMatrix Barcode.
        my $my_barcode = $data->echo_barcode(); # Return a human-readable string of the encoded data.
        
        $data->barcode = "A new barcode.";              # To render a new barcode with the same object.
        $data->target = 'stdout';
        $data->encode();
        $data->render();                                                # etc.

Overview

This class is used to create graphical representations of data matrix barcodes. It is an extension of the Barcode::DataMatrix class. Potential applications include graphically oriented documents such as PDF, printable web documents, invoices, packing lists, shipping labels, etc....

Methods

new (%attributes)

Minimal initiation of a barcode object is new(barcode=>"yourtext"). Options may be added via the %attributes in any order.

Default settings of output to "STDOUT" with a resolution of 3 pixels will be used unless changed.

encode ()

Encode the barcode string into DataMatrix format. An "encode()" must be completed prior to rendering a barcode.

render ()

Render a PNG image of the created barcode. The graphic will be rendered based on settings selected.

An exception may be thrown by foundation classes if they are unable to generate the barcode data or graphics.

echo_barcode()

Echo a human-readable representation of the barcode data stored in $this->{"barcode"}

Attributes

barcode

Ascii string data to be inserted into the barcode.

resolution

The resolution (in pixels) of the barcode to be generated. The default setting is 3 pixels resolution.

target

Default output is "stdout". Options are "stdout" or "pass". Pass will "return()" the barcode PNG data for use.

Source repository

<https://github.com/KasemOmary/Barcode-DataMatrix-PNG>

Releases

4 releases since Debian 10 (Buster); the text changed 2 times.

  1. 10
  2. 11
  3. 12–13

Author

Kasem Omary<< <[email protected]> >>

From libbarcode-datamatrix-png-perl 0.04-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.