0
<?php
$pdf=pdf_new();
pdf_open_file($pdf, "test.pdf");
pdf_begin_page($pdf, 595, 842);
$arial = pdf_findfont($pdf, "Arial", "host", 1);
pdf_setfont($pdf, $arial, 10);
pdf_show_xy($pdf, "There are more things in heaven and earth, Horatio,",50, 750);
pdf_end_page($pdf);
pdf_show_xy($pdf, "than are dreamt of in your philosophy", 50,730);
pdf_close($pdf);
?>
錯誤是什麼:致命錯誤不知道錯誤
Fatal error: Uncaught exception 'PDFlibException' with message 'Function must not be called in 'object' scope' in /var/www/Sample/sam.php:4 Stack trace: #0 /var/www/Sample/sam.php(4): pdf_begin_page(Resource id #2, 595, 842) #1 {main} thrown in /var/www/Sample/sam.php on line 4
這幾乎是同樣的問題:http://stackoverflow.com/questions/997627/pdflib-giving-an-uncaught-exception-error做到這一點解決你的問題? – Xavjer 2013-04-11 13:29:10
希望這可以幫助你http://php.net/manual/en/function.pdf-open-file.php – Rikesh 2013-04-11 13:30:08
@Xavjer還有問題沒有解決它看起來像沒有答案的問題 – user1370510 2013-04-11 13:35:57