1
내가 localhost/invoice
에있는 두 개의 파일이 x.php
및 template.php
, 명명 한 후, 나는이 같은 URL이 있습니다?PHP 스크립트의 HTML 출력을 PDF로 변환 하시겠습니까?
로컬 호스트/송장/template.php 이름 = wawan
을 어떻게 할 수 출력 페이지를 PDF로 변환 하시겠습니까? 내가 원하는 것은 x.php
에 액세스 한 다음 변환 된 template.php
을 얻는 것입니다. mpdf를 사용해 보았지만 작동하지 않습니다.
<?php
include("MPDF54/mpdf.php");
$mpdf=new mPDF('c','A4','','' , 0 , 0 , 0 , 0 , 0 , 0);
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
$mpdf->WriteHTML(file_get_contents('template.php?name=wawan'));
$mpdf->Output();
?>
을 그리고 이것은 template.php
입니다 :
여기 x.php
의
<div> The name is :
<?php
echo $_GET[name];
?>
은 무엇 "작동하지 않습니다"무엇을 의미합니까? 어떻게 작동하지 않습니까? 출력이 올바르지 않습니까? 그게 뭐가 잘못 됐어? 오류 메시지가 나타 납니까? 그렇다면 오류 메시지의 내용은 무엇입니까? –
이 게시물을 확인하는 것이 좋습니다. http://stackoverflow.com/questions/391005/convert-html-css-to-pdf-with-php –