2013-02-26 219 views
8

如何將通過HTML2PDF生成的pdf文件的頁面方向更改爲橫向...? 默認情況下,它以縱向格式打開。我在html2pdf.class改變了它,但沒有changed.Please幫助我..如何使用HTML2PDF設置橫向方向

這是PHP代碼:

require('../../includes/html2pdf/html2fpdf.php'); 
    $pdf=new HTML2FPDF('L','mm','A3'); 
    $pdf->AddPage(); 
    $pdf->setFont("arial",'',8); 
    $pdf->WriteHTML($data); 
    $pdf->Output("outstanding.pdf","I"); 
+0

你解決了這個問題嗎? – shorif2000 2013-06-04 16:27:30

回答

3

使用L作爲構造函數的參數應該只是罰款。不要混淆類內部。

這是我唯一的代碼,它工作正常。嘗試使用最新版本:HTML2PDF

// convert to PDF 
require_once('../../vendor/html2pdf_v4.03/html2pdf.class.php'); 
try 
{ 
    $html2pdf = new HTML2PDF('L', 'A4', 'en'); 
    $html2pdf->setDefaultFont('Arial'); 
    $html2pdf->writeHTML($html, false); 
    $html2pdf->Output('output.pdf', 'D'); 
} 
catch(HTML2PDF_exception $e) { 
    echo $e; 
    exit; 
} 
相關問題