【问题标题】:Zend-pdf: Pdf does not begin with %PDF-1.4Zend-pdf:Pdf 不以 %PDF-1.4 开头
【发布时间】:2012-09-07 05:39:41
【问题描述】:

我在magento 1.7中尝试过如下

 $pdf = new Zend_Pdf(); 
  ....
  ....
 $pdfString = $pdf->render();
 header("Content-Disposition: attachment; filename=helloworld.pdf");
 header("Content-type: application/x-pdf");
 echo $pdfString;

现在的问题是,生成 PDF 时会抛出错误消息:Pdf does not begin with %PDF-1.4。我还注意到它包含 html 内容。谁能告诉我我应该怎么做才能避免 html 内容被附加到 Pdf 自己的内容中。

【问题讨论】:

    标签: php zend-framework header http-headers zend-pdf


    【解决方案1】:

    zend_pdf document issue in windows 7 的副本

    echo 语句之前粘贴ob_end_clean()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-28
      • 1970-01-01
      • 2016-03-18
      • 2012-12-09
      相关资源
      最近更新 更多