Php 如何清洁magento收割台
我试图在模块中的magento视图中显示PDF 我使用html2fpdf.php,在普通的php页面中,除了一个magento phtml页面之外,一切都很好 我收到了:Php 如何清洁magento收割台,php,magento,pdf,Php,Magento,Pdf,我试图在模块中的magento视图中显示PDF 我使用html2fpdf.php,在普通的php页面中,除了一个magento phtml页面之外,一切都很好 我收到了:%PDF-1.3 3 0 obj endobj,还有更多 我认为这可能是magento标题的问题: <?php header_remove(); header('Content-type: application/pdf'); include_once ('htmlpdf/html2fpdf.php'); $pdff
%PDF-1.3 3 0 obj endobj
,还有更多
我认为这可能是magento标题的问题:
<?php
header_remove();
header('Content-type: application/pdf');
include_once ('htmlpdf/html2fpdf.php');
$pdff = "
<html>
<head>
<title>Titulo del archivo pdf</title>
</head>
<body>
<p>Este es el texto del archivo pdf. Podemos incluir imagenes, enlaces, etc.</p>
</body>
</html>
";
$pdf = new html2fpdf();
$pdf->AddPage();
$pdf -> WriteHTML($pdff);
$pdf -> Output();
看一看@
可能意味着您的header()
调用由于以前的输出而失败,浏览器将您的pdf视为text/plain或text/html。谢谢,我迷路了2天,jajashure谢谢,我会看看我是怎么做的这是我的第一篇帖子。
$this->getResponse()
->clearHeaders()
->setHeader('Content-Type', 'application/pdf')
->setBody(set pdf output here);