Использование Magento с Zend_Pdf и несколько пользовательских классов, которые позволяют печатать/загружать PDF-файлы с определенными спецификациями заголовка/таблицы. Проблема в том, что он отключается после первой страницы и не создает новую страницу, когда список элементов содержит более 20 элементов.При использовании Magento PDF обрезается после первой страницы
Этот код:
public function getOutput()
{
$this->pages[] = $this->page;
return $this->render();
}
И этот код:.
$pdf = new PrintPdf();
$pdf->generate($sourceData);
$output = $pdf->getOutput();
echo $output;
ли где я считаю, что ошибка происходит в случае, если я изменю «возвращение» в первом коде «эхо» он выведет правильные данные в браузер, но когда я попытаюсь передать его через второй код, он выведет только одну страницу данных.
Любой совет будет оценен по мере того, как я работал над этим около 2 недель.
UPDATE:
мне сказали, этот кусок кода:
private function drawLineItems($tableData)
{
$this->drawHeading($this->__('Line Items'));
// Draw table
$this->decOffset(35);
$this->colorLine(cBLUE);
$this->page->setLineWidth(0.5);
$this->page->drawLine($this->pMargin, $this->yOffset, $this->pWidth - $this->pMargin, $this->yOffset);
$this->fontSize(FONT_SMALL);
$this->colorFill(cBLUE);
$this->decOffset(15);
$sum = ($this->pMargin + 10);
for($idx = 0; $idx < sizeof($tableData['heading']); $idx++) {
$pos = $sum;
$this->page->drawText($tableData['heading'][$idx], $sum, $this->yOffset);
$sum += ($tableData['width'][$idx] + 10);
$tableData['width'][$idx] = $pos;
}
$this->decOffset(10);
$this->page->drawLine($this->pMargin, $this->yOffset, $this->pWidth - $this->pMargin, $this->yOffset);
$this->fontSize(8);
$this->colorFill(cLIGHT);
$this->colorLine(cBORDER);
foreach($tableData['rows'] as $row) {
$this->decOffset(15);
$yOffset = $this->yOffset;
for($idx = 0; $idx < sizeof($row); $idx++) {
if ($tableData['heading'][$idx] == 'Description') {
$lines = $this->_breakTextToLines($row[$idx], $tableData['width'][$idx + 1] - $tableData['width'][$idx]);
foreach ($lines as $line) {
$this->page->drawText($line, $tableData['width'][$idx], $yOffset);
$yOffset -= 10;
}
} else {
$this->page->drawText($row[$idx], $tableData['width'][$idx], $this->yOffset);
}
}
$this->decOffset($this->yOffset - $yOffset);
$this->page->drawLine($this->pMargin, $this->yOffset, $this->pWidth - $this->pMargin, $this->yOffset);
}
$this->decOffset(20);
$this->fontSize(FONT_NORMAL);
$this->colorFill(cDARK);
$this->page->drawText($this->__('Grand Total') . ': ' . $tableData['total'], $this->pWidth - 125, $this->yOffset);
}
, вероятно, где проблема, как она не образует новую страницу после определенного количества элементов. Сейчас моя задача заключается в выполнении этой задачи. Помощь по-прежнему ценится.