Barcode::DataMatrix::PNG(3p)

NAME
Barcode::DataMatrix::PNG - Generate PNG graphical representations of Data Matrix barcodes

SYNOPSIS
    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.

DESCRIPTION
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.

AUTHOR
Kasem Omary<< <kasemo@cpan.org> >>

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

SEE ALSO

HTML::Barcode::DataMatrix

LICENSE AND COPYRIGHT
Copyright 2014 the AUTHORs listed above.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.