문제

I have tried as following in 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;

Now the issue is that when PDF is generated it throws error message: Pdf does not begin with %PDF-1.4. Also I noticed that it contains html contents. Can anyone please tell me what should I do in order to avoid html contents from being appended with Pdf's own contents.

도움이 되었습니까?

해결책

Duplicate of zend_pdf document issue in windows 7

Stick ob_end_clean() before the echo statement.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top