Mercurial > mercurial > hgweb_golang.cgi
view src/kaigo/fwgo/atena.pl @ 58:62ae9daac43a
start develop horori/eraline.
author | pyon@macmini |
---|---|
date | Thu, 06 Aug 2020 19:50:15 +0900 |
parents | 05f3d51ad966 |
children |
line wrap: on
line source
# あてなをつくる # Last Change: 2020-07-15 水 15:55:32. # # C:\> perl atena.pl input.pdf output.pdf # use utf8; use PDF::API2; my $bg_file = 'bg.pdf'; my ($in_file, $out_file) = ($ARGV[0], $ARGV[1]); if ($in_file eq '' || $out_file eq '') { print "bad arguments.\n"; exit; } my $new_pdf = PDF::API2->new(); my $in_pdf = PDF::API2->open($in_file); my $bg_pdf = PDF::API2->open($bg_file); for my $p (1..$in_pdf->pages) { my $page = $new_pdf->page(); $page->mediabox('A4'); my $gfx = $page->gfx(); # send to my $xo = $new_pdf->importPageIntoForm($in_pdf, $p); $gfx->formimage($xo, 15, 615, 0.9); # background $xo = $new_pdf->importPageIntoForm($bg_pdf, 1); $gfx->formimage($xo, 0, 0, 1.0); } $new_pdf->saveas($out_file); $new_pdf->end; $in_pdf->end; $bg_pdf->end;