次の要件でレポートを作成しようとしています。
- すべてのページにヘッダー (ライターの名前、レポートの日付など) があります。
 - 次に、ドキュメントを説明するテキストが表示されます (例: デバイスの名前、IP など)。
 - 次に、数ページになる表があります。
 
私が抱えている問題は、ステップ 2 と 3 を組み合わせるたびに、それぞれが別のページになることです。表をテキストの直後にしたい。
PDF::API2、PDF::Table、および PDF:Reuse を試しました (2 つの部分を結合するため)。
それでも、それぞれが別のページに表示されます。助言がありますか?
コードは次のとおりです。PDF::テーブルを使用します。PDF を使用::再利用;
my $pdftable = new PDF::Table;
my $pdf = new PDF::API2(-file => "1.pdf");
my $page = $pdf->page;
$hdr_props = 
{
        # This param could be a pdf core font or user specified TTF.
        #  See PDF::API2 FONT METHODS for more information
        font       => $pdf->corefont("Times", -encoding => "utf8"),
        font_size  => 10,
        font_color => '#006666',
        bg_color   => 'gray',
       repeat     => 1,    # 1/0 eq On/Off  if the header row should be repeated to every new       page
    };
# some data to layout
my $some_data =[
["1 Lorem ipsum dolor",
"Donec odio neque, faucibus vel",
"consequat quis, tincidunt vel, felis."],
["Nulla euismod sem eget neque.",
"Donec odio neque",
"Sed eu velit."],
["Nulla euismod sem eget neque.",
"Donec odio neque",
"Sed eu velit."],
["Nulla euismod sem eget neque.",
"Donec odio neque",
"Sed eu velit."],
["Nulla euismod sem eget neque.",
"Donec odio neque",
"Sed eu velit."],
#... and so on
];
   $left_edge_of_table = 50;
   # build the table layout
  $pdftable->table(
    # required params
    $pdf,
    $page,
    $some_data,
    x => $left_edge_of_table,
    w => 495,
    start_y => 750,
    next_y  => 700,
    start_h => 300,
    next_h  => 500,
    # some optional params
     padding => 5,
     padding_right => 10,
     background_color_odd  => shift @_ || "#FFFFFF",
     background_color_even => shift @_ || "#FFFFCC", #cell background color for even rows
     header_props   => $hdr_props, # see section HEADER ROW PROPERTIES
   );
  $pdf->saveas();
# Open an existing PDF file
$pdf = new PDF::API2(-file => "2.pdf");
$page = $pdf->page;
# Add a built-in font to the PDF
$font = $pdf->corefont('Helvetica-Bold');
# Add some text to the page
$text = $page->text();
$text->font($font, 20);
$text->translate(200, 700);
text->text('Hello World!');
  # Save the PDF
  $pdf->saveas();
prFile("report.pdf");
prDoc("2.pdf");
prDoc("1.pdf");
prEnd();