in reply to Placing 2D Datamatrix on PDF
This basically seems to work, sweeten to taste:
use Barcode::DataMatrix; use PDF::API2; my $x = 100; my $y = 200; my $sz = 10; my $mat = Barcode::DataMatrix->new()->barcode('Hello World'); my $pdf = PDF::API2->open('original.pdf'); my $page = $pdf->openpage(1); my $content = $page->gfx(); for my $i (0 .. $#$mat) { for my $j (0 .. $#{$mat->[$i]}) { if ($mat->[$i][$j]) { $content->rect($x+$sz*$j, $y-$sz*$i, $sz, $sz); } } } $content->fill(); $pdf->saveas('modified.pdf');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Placing 2D Datamatrix on PDF
by Anonymous Monk on Jan 20, 2014 at 08:46 UTC | |
|
Re^2: Placing 2D Datamatrix on PDF
by Anonymous Monk on Apr 22, 2014 at 08:37 UTC | |
|
Re^2: Placing 2D Datamatrix on PDF
by Anonymous Monk on Nov 04, 2014 at 13:55 UTC | |
by choroba (Cardinal) on Nov 04, 2014 at 15:10 UTC |