2008年9月12日 星期五

[PHP]產生PDF問題

出現的問題
============================

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\pdftest.php:9) in C:\AppServ\www\class.pdf.php on line 1916

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\pdftest.php:9) in C:\AppServ\www\class.pdf.php on line 1917

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\pdftest.php:9) in C:\AppServ\www\class.pdf.php on line 1919
%PDF-1.3 %睼珃 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Creator (R and OS php pdf writer, http://www.ros.co.nz) /CreationDate (D:20080910) >> endobj 6 0 obj << /Type /Page /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 61 >> stream xr Q06?00P?0?66P IQ苡3T0 ?)(hd斗鳵??憭h*)?@?E endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj xref 0 9 0000000000 65535 f 0000000015 00000 n 0000000080 00000 n 0000000126 00000 n 0000000280 00000 n 0000000309 00000 n 0000000414 00000 n 0000000477 00000 n 0000000610 00000 n trailer << /Size 9 /Root 1 0 R /Info 5 0 R >> startxref 717 %%EOF

=================問題解法===============
這一個問題的原因是因為我在php的檔案裡有加了html的關係,因為我是把
程式
?>

加在< body> 與< /body>之間
然後沒有在windows裡頭php.ini也要加上;include_path='.;C:\php5\pear'
這一行。
程式
>?
單純放在php網頁檔去跑,這樣就可以成功發佈PDF檔了。

沒有留言: