Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
i want to add my logo to every pdf file in the following way:
1. shift the page 2cm down. 2. add the logo in the new place i've created.
My problem: i have to change the $x and $y for every pdf and i want it to be global for every pdf.use PDF::API2 qw(); { my $pdf = PDF::API2->open('AAnew.pdf'); for my $index (1 .. $pdf->pages) { my $page = $pdf->openpage($index); $page->mediabox('A4'); #my $txt = $page->text; #$txt->textlabel(300, 700, $pdf->corefont('Helvetica Bold'), 1 +2, 'some Header text'); my $gfx = $page->gfx; $gfx->image($pdf->image_png('aa.png'), 0,0,150,50); $gfx->close; #$txt->textlabel(300, 100, $pdf->corefont('Helvetica Bold'), 1 +2, "Page: $index"); } $pdf->saveas('outputIT.pdf'); $pdf->end; }
i want to add the logo to the SAME posisiton for every pdf file. thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PDF API2
by thanos1983 (Parson) on May 04, 2017 at 11:54 UTC | |
|
Re: PDF API2
by vr (Curate) on May 04, 2017 at 13:54 UTC |