我想同樣的文檔轉換爲PDF或我要在URL添加POST方法就像:轉換同一頁面PDF
$dompdf->loadHtml($_POST['name']);
下面是代碼:
<?php
// include autoloader
require_once 'dompdf/autoload.inc.php';
// reference the Dompdf namespace
use Dompdf\Dompdf;
// instantiate and use the dompdf class
$dompdf = new Dompdf();
$dompdf->loadHtml(file_get_contents('http://localhost/));
// (Optional) Setup the paper size and orientation
$dompdf->setPaper(array(0,0,850,2250), 'landscape');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
//$dompdf->stream();
// Output the generated PDF (1 = download and 0 = preview)
$dompdf->stream("codex",array("Attachment"=>0));
?>
對,這是什麼問題? – RiggsFolly
你是否看到缺少的單引號?顏色編碼告訴你有一個問題 – RiggsFolly
沒有沒有任何問題,我可以使用這個URL創建一個PDF,但我想在這裏添加Post方法,所以我可以在這裏添加來自HTML的URL –