解决方案 »

  1.   

    给你一个实例
    <?php
    require('html2fpdf.php');$pdf=new HTML2FPDF();
    $pdf->AddPage();
    $fp = fopen("sample.html","r");
    $strContent = fread($fp, filesize("sample.html"));
    fclose($fp);
    $pdf->WriteHTML($strContent);
    $pdf->Output("sample.pdf");
    echo "PDF file is generated successfully!";
    ?>
      

  2.   

    这个是html2fpdf的代码,这个好像只能转化文本吧我需要转化一些很复杂的图片
      

  3.   

    先保存为一般格式 的图片,再转换成pdf 不行么?