Mercurial > mercurial > hgweb_golang.cgi
comparison src/kaigo/fwgo/atena2.pl @ 57:05f3d51ad966
add fwgo.
| author | pyon@macmini |
|---|---|
| date | Wed, 15 Jul 2020 18:18:24 +0900 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 56:7396e7407abd | 57:05f3d51ad966 |
|---|---|
| 1 # あてなをつくる(PNGバージョン) | |
| 2 # Last Change: 2020-07-15 水 15:56:39. | |
| 3 # | |
| 4 # C:\> perl atena.pl input.pdf output.pdf | |
| 5 # | |
| 6 | |
| 7 use utf8; | |
| 8 use PDF::API2; | |
| 9 | |
| 10 my ($in_file, $out_file) = ($ARGV[0], $ARGV[1]); | |
| 11 if ($in_file eq '' || $out_file eq '') { | |
| 12 print "bad arguments.\n"; | |
| 13 exit; | |
| 14 } | |
| 15 | |
| 16 my $new_pdf = PDF::API2->new(); | |
| 17 | |
| 18 my $img = $new_pdf->image_png('leaflet.png'); | |
| 19 my $font = $new_pdf->cjkfont('kozmin', 1); | |
| 20 | |
| 21 my $in_pdf = PDF::API2->open($in_file); | |
| 22 for my $p (1..$in_pdf->pages) { | |
| 23 my $page = $new_pdf->page(); | |
| 24 $page->mediabox('A4'); | |
| 25 my $gfx = $page->gfx(); | |
| 26 | |
| 27 # send to | |
| 28 my $xo = $new_pdf->importPageIntoForm($in_pdf, $p); | |
| 29 $gfx->formimage($xo, 15, 615, 0.9); | |
| 30 | |
| 31 # leaflet | |
| 32 $gfx->transform(-translate => [50, 170], -scale => [0.5, 0.5]); | |
| 33 $gfx->image($img); | |
| 34 $gfx->transform(-translate => [0, 0], -scale => [2, 2]); | |
| 35 | |
| 36 # title | |
| 37 my $s = "介護保険負担割合証の送付について"; | |
| 38 my $title = $page->text(); | |
| 39 $title->translate(160, 430); | |
| 40 $title->font($font, 10.5); | |
| 41 $title->text($s); | |
| 42 | |
| 43 # comment | |
| 44 $s = "令和2年度介護保険負担割合証を送付いたします。"; | |
| 45 my $comment1 = $page->text(); | |
| 46 $comment1->translate(-10, 380); | |
| 47 $comment1->font($font, 9.5); | |
| 48 $comment1->text($s); | |
| 49 | |
| 50 $s = "所得の修正申告や世帯員の変更(65歳以上)などがあった場合は、有効期間内であっても負担割が変更になる場合があります。"; | |
| 51 my $comment3 = $page->text(); | |
| 52 $comment3->translate(-10, 365); | |
| 53 $comment3->font($font, 9.5); | |
| 54 $comment3->text($s); | |
| 55 | |
| 56 $s = "※ 第2号被保険者(40歳以上65歳未満の方)、市町民税非課税の方、生活保護受給者は下記にかかわらず1割負担です。"; | |
| 57 my $comment3 = $page->text(); | |
| 58 $comment3->translate(-10, 340); | |
| 59 $comment3->font($font, 9.5); | |
| 60 $comment3->text($s); | |
| 61 | |
| 62 # from | |
| 63 $s = "大曲仙北広域市町村圏組合 介護保険事務所"; | |
| 64 my $from1 = $page->text(); | |
| 65 $from1->translate(200, -75); | |
| 66 $from1->font($font, 9.5); | |
| 67 $from1->text($s); | |
| 68 | |
| 69 $s = "〒014-0805 秋田県大仙市高梨字田茂木10(大仙市役所仙北庁舎3階)"; | |
| 70 my $from2 = $page->text(); | |
| 71 $from2->translate(200, -95); | |
| 72 $from2->font($font, 9.5); | |
| 73 $from2->text($s); | |
| 74 | |
| 75 $s = "電話 0187-86-3911"; | |
| 76 my $from3 = $page->text(); | |
| 77 $from3->translate(200, -105); | |
| 78 $from3->font($font, 9.5); | |
| 79 $from3->text($s); | |
| 80 | |
| 81 if (0) { | |
| 82 # hhs info | |
| 83 $xo = $new_pdf->importPageIntoForm($in_pdf, $p); | |
| 84 $gfx->formimage($xo, 355, 330, 0.6); | |
| 85 | |
| 86 # write-box | |
| 87 $gfx->rect(300, 345, 200, 100); | |
| 88 $gfx->fillcolor('#ffffff'); | |
| 89 $gfx->fill(); | |
| 90 } | |
| 91 } | |
| 92 | |
| 93 $new_pdf->saveas($out_file); | |
| 94 $new_pdf->end | |
| 95 |
