문제

I am having problems adding multiple pages to a PDF document using the great PHP wkHTMLToPdf wrapper.

The following code just gives me a blank page

require_once('phpwkhtmltopdf/WkHtmlToPdf.php');
$pdf = new WkHtmlToPdf;

$pdf->addPage('http://www.google.co.uk');
$pdf->addPage('http://www.google.co.uk');

$pdf->send('test.pdf');
exit();

but this works fine.

require_once('phpwkhtmltopdf/WkHtmlToPdf.php');
$pdf = new WkHtmlToPdf;

$pdf->addPage('http://www.google.co.uk');

$pdf->send('test.pdf');
exit();
도움이 되었습니까?

해결책

The problem was because I had used apt-get install to install wkhtmltopdf but doing this provides a very limited solution i.e. a number of options are omitted including adding more than one page. By downloading and installing manually everything worked.

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