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