Mercurial > mercurial > hgweb_golang.cgi
diff src/kaigo/fwgo/atena2.pl @ 57:05f3d51ad966
add fwgo.
author | pyon@macmini |
---|---|
date | Wed, 15 Jul 2020 18:18:24 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/kaigo/fwgo/atena2.pl Wed Jul 15 18:18:24 2020 +0900 @@ -0,0 +1,95 @@ +# あてなをつくる(PNGバージョン) +# Last Change: 2020-07-15 水 15:56:39. +# +# C:\> perl atena.pl input.pdf output.pdf +# + +use utf8; +use PDF::API2; + +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 $img = $new_pdf->image_png('leaflet.png'); +my $font = $new_pdf->cjkfont('kozmin', 1); + +my $in_pdf = PDF::API2->open($in_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); + + # leaflet + $gfx->transform(-translate => [50, 170], -scale => [0.5, 0.5]); + $gfx->image($img); + $gfx->transform(-translate => [0, 0], -scale => [2, 2]); + + # title + my $s = "介護保険負担割合証の送付について"; + my $title = $page->text(); + $title->translate(160, 430); + $title->font($font, 10.5); + $title->text($s); + + # comment + $s = "令和2年度介護保険負担割合証を送付いたします。"; + my $comment1 = $page->text(); + $comment1->translate(-10, 380); + $comment1->font($font, 9.5); + $comment1->text($s); + + $s = "所得の修正申告や世帯員の変更(65歳以上)などがあった場合は、有効期間内であっても負担割が変更になる場合があります。"; + my $comment3 = $page->text(); + $comment3->translate(-10, 365); + $comment3->font($font, 9.5); + $comment3->text($s); + + $s = "※ 第2号被保険者(40歳以上65歳未満の方)、市町民税非課税の方、生活保護受給者は下記にかかわらず1割負担です。"; + my $comment3 = $page->text(); + $comment3->translate(-10, 340); + $comment3->font($font, 9.5); + $comment3->text($s); + + # from + $s = "大曲仙北広域市町村圏組合 介護保険事務所"; + my $from1 = $page->text(); + $from1->translate(200, -75); + $from1->font($font, 9.5); + $from1->text($s); + + $s = "〒014-0805 秋田県大仙市高梨字田茂木10(大仙市役所仙北庁舎3階)"; + my $from2 = $page->text(); + $from2->translate(200, -95); + $from2->font($font, 9.5); + $from2->text($s); + + $s = "電話 0187-86-3911"; + my $from3 = $page->text(); + $from3->translate(200, -105); + $from3->font($font, 9.5); + $from3->text($s); + + if (0) { + # hhs info + $xo = $new_pdf->importPageIntoForm($in_pdf, $p); + $gfx->formimage($xo, 355, 330, 0.6); + + # write-box + $gfx->rect(300, 345, 200, 100); + $gfx->fillcolor('#ffffff'); + $gfx->fill(); + } +} + +$new_pdf->saveas($out_file); +$new_pdf->end +