我想同时创建多个 PDF。但每个文档总是覆盖。第一个没问题,但之后第二个和第三个文本被覆盖。
<?php
try {
$pdf = new My_Pdf();
$page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES);
$page->setFont($font, 11);
$data = Model_DefendantsBanksMapper::getInstance()->getForPDF($values[0]['id']);
foreach ($data as $k => $defendant) {
$pdf->drawText($page, $defendant, 85, 660);
$pdf->pages[] = $page;
$pdf->save('pdf/Bank_Supoena_' . $values[0]['id'] . '_' . $k . '.pdf');
}
} catch (Zend_Pdf_Exception $e) {
die('PDF error: ' . $e->getMessage());
} catch (Exception $e) {
die('Application error: ' . $e->getMessage());
}
?>