我不知道爲什麼,但我的pdf批處理不起作用,現在我有這個錯誤。 來自類while循環FPDF出錯
內部的問題,謝謝
Notice: OM\Registry::set - Order already registered and is not forced to be replaced in /home/www/shop/includes/OM/Registry.php on line 33 Fatal error: Uncaught Exception: FPDF error: Some data has already been output, can't send PDF file in /home/www/boutique/ext/fpdf/fpdf.php:271 Stack trace: #0 /home/www/boutique/ext/fpdf/fpdf.php(1063): FPDF->Error('Some data has a...') #1 /home/www/boutique/ext/fpdf/fpdf.php(999): FPDF->_checkoutput() #2 /home/www/boutique/admin/invoice_batch.php(570): FPDF->Output() #3 {main} thrown in /home/www/boutique/ext/fpdf/fpdf.php on line 271
此錯誤是有關與此元素
// Classe pdf.php
$pdf = new \FPDF();
// $pdf->SetWidths(array(30,50,30,40));
while ($QordersInfo->fetch()) {
Registry::set('Order', new OrderAdmin($QordersInfo->valueInt('orders_id')));
$order = Registry::get('Order');
...
..
}
// PDF's created no
// output the file
$pdf->Output();
如果我寫了這一點,「完美的作品」,但它只顯示1張發票。
// Classe pdf.php
$pdf = new \FPDF();
// $pdf->SetWidths(array(30,50,30,40));
while ($QordersInfo->fetch()) {
Registry::set('Order', new OrderAdmin($QordersInfo->valueInt('orders_id')));
$order = Registry::get('Order');
.....
// output the file
$pdf->Output();
}
很容易理解錯誤:「有些數據已經輸出,不能發送PDF文件。」在嘗試輸出PDF之前,還有其他東西已經輸出。 – miken32
請提供您完整的代碼,以使我們清楚地瞭解它... –
您在呈現PDF文檔之前獲得一些輸出,禁止您的通知,在ini_set中發出警告輸出.... –