2016-11-20 7 views
0

に同じページを変換するか、私は、URLにPOSTメソッドを追加したいは、私はPDFに同じ文書を変換したいPDF

<?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)); 
?> 
+0

問題は何ですか? – RiggsFolly

+2

不足している一重引用符がありますか?色のコードは問題があることを示します – RiggsFolly

+0

いいえ問題はありません。このURLを使用してPDFを作成できますが、私はここにPostメソッドを追加したいので、ここからHTMLを追加できます –

答えて

-3

ますfile_get_contentsの場合、一重引用符が欠落しています

<?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)); 
?> 
+2

コメント。これは実際にその質問に答えるつもりはありません! – RiggsFolly

+0

コメントの前に、私は答えを入力してコメントの後に投稿しました。見積もりが見つからない場合は、それは動作しますか?絶対にない。そして私がそれを訂正しているなら、それを下降させる必要はない。私は正しい方向に動く答えを出しています。 –

+0

___Sentence 2:___これは質問されたように質問に回答しようとしません – RiggsFolly

関連する問題