GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Imager::QRCode(3) User Contributed Perl Documentation Imager::QRCode(3)

Imager::QRCode - Generate QR Code with Imager using libqrencode

    use Imager::QRCode;

    my $qrcode = Imager::QRCode->new(
        size          => 2,
        margin        => 2,
        version       => 1,
        level         => 'M',
        casesensitive => 1,
        lightcolor    => Imager::Color->new(255, 255, 255),
        darkcolor     => Imager::Color->new(0, 0, 0),
    );
    my $img = $qrcode->plot("blah blah");
    $img->write(file => "qrcode.gif")
      or die "Failed to write: " . $img->errstr;

    # or exporting function
    use Imager::QRCode qw(plot_qrcode);

    my $img = plot_qrcode("blah blah", \%params);
    $img->write(file => "qrcode.gif")
      or die "Failed to write: " . $img->errstr;

This module allows you to generate QR Code with Imager. This module use libqrencode '2.0.0' and above.

new
    $qrcode = Imager::QRCode->new(%params);
    

The "new()" constructor method instantiates a new Imager::QRCode object. "new()" accepts the following parameters.

  • "size" - Horizontal and vertical size of module(dot). Default is 4.
  • "margin" - Margin size of QR Code. Default is 3.
  • "level" - Error correction level. Valid values are 'M', 'L', 'Q' or 'H'. Default is 'L'.
  • "version" - Version of the symbol. If specify '0', this module chooses the minimum version for the input data. Default is '0'.
  • "mode" - Encoding mode. Valid values are 'numerical', 'alpha-numerical', '8-bit' or 'kanji'. Default is '8-bit'.

    If not give "casesensitive" then should be given "mode". If 'kanji' is given, characters will be encoded as Shift-JIS characters. If '8-bit' is given, all of non-alpha-numerical characters will be encoded as is. If you want to embed UTF-8 string, choose '8-bit'.

  • "casesensitive" - If your application is case-sensitive using 8-bit characters, set to '1'. Default is '0'.
plot($text)
    $img = $qrcode->plot("blah blah");
    

Create a new QR Code image. This method returns Imager object plotted QR Code with the given text.

plot_qrcode($text, \%params)
$text is input text. %params is same paramater as "new()".

"Imager", "http://www.qrcode.com/", "http://megaui.net/fukuchi/works/qrencode/index.en.html"

Yoshiki KURIHARA "<kurihara __at__ cpan.org>"

Tokuhiro Matsuno

Copyright (c) 2011, Yoshiki KURIHARA "<kurihara __at__ cpan.org>".

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

2016-10-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.