Skip to content

Instantly share code, notes, and snippets.

@ichigotake
Created November 11, 2012 11:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ichigotake/4054634 to your computer and use it in GitHub Desktop.
Save ichigotake/4054634 to your computer and use it in GitHub Desktop.
CAM::PDFを利用して複数のPDFを結合するスクリプトサンプル
#!/usr/bin/env perl
# CAM::PDF - search.cpan.org
# http://search.cpan.org/~cdolan/CAM-PDF-1.58/lib/CAM/PDF.pm
use strict;
use warnings;
use CAM::PDF;
# 結合するPDFのファイル名を指定してインスタンス生成
my $pdf1 = CAM::PDF->new('1.pdf');
my $pdf2 = CAM::PDF->new('2.pdf');
# $pdf1の後ろに$pdf2を結合
$pdf1->appendPDF($pdf2);
# 結合したPDFを出力するファイル名を指定
$pdf1->cleanoutput('out.pdf');
# 結合したPDFを出力
$pdf1->toPDF();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment