Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oetiker/pdf-qrcode

Package to add a qrcode method to the PDF::API2 and PDF::Builder classes.
https://github.com/oetiker/pdf-qrcode

pdf-generation perl qrcode-generator

Last synced: 2 months ago
JSON representation

Package to add a qrcode method to the PDF::API2 and PDF::Builder classes.

Awesome Lists containing this project

README

        

![](https://github.com/oetiker/pdf-qrcode/workflows/Unit%20Tests/badge.svg?branch=main)

# NAME

PDF::QRCode - add qrcode method to a PDF::API2 or PDF::Builder.

# SYNOPSIS

```perl
use PDF::API2; # or PDF::Builder
use PDF::QRCode;

my $pdf = PDF::API2->new(-file=>'qr.pdf');
$pdf->mediabox('a4');
my $gfx = $pdf->page->gfx;
$gfx->qrcode(x => 100, y => 100,
level => 'L', size => 40, text => 'Hello World');
$pdf->save;
```

# DESCRIPTION

The [PDF::QRCode](https://metacpan.org/pod/PDF%3A%3AQRCode) module monkey patches the 'qrcode' method into the
[PDF::API2::Content](https://metacpan.org/pod/PDF%3A%3AAPI2%3A%3AContent) or [PDF::Builder::Content](https://metacpan.org/pod/PDF%3A%3ABuilder%3A%3AContent) class, so that you can use it directly from there. See the example above

## $gfx->qrcode(%cfg)

Adds a qr code to the given gfx content. It expects the following parameters:

- x

horizontal position

- y

vertical position

- size

width/height

- text

the content of the qrcode

- level (optional)

qr code level `L`, `M`, `Q`, `H`

# AUTHOR

Tobias Oetiker, 

# COPYRIGHT

Copyright OETIKER+PARTNER AG 2020

# LICENSE

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10 or,
at your option, any later version of Perl 5 you may have available.