问题描述:

Using the above version of wkhtmltopdf, I have a php file that generates a pdf from a url. If I include the tag --lowquality, I get a blank page at the beginning of the pdf.

I need to include the --lowquality tag as the content of the url I send is to great to generate w/o --lowquality.

adds blank page...

<?php

require_once('wkhtmltopdf.php');

$pdf_file_name = "report.pdf";

$URL = $_GET['URL'];

if(isset($URL)){

try {

$pdf=new WKPDF();

$pdf->set_url($URL);

$pdf->args_add("--javascript-delay", "3000");

$pdf->args_add("--zoom", ".7");

$pdf->args_add("--margin-top", "5");

$pdf->args_add("--margin-bottom", "5");

$pdf->args_add("--lowquality");

$pdf->args_add("--load-error-handling", "ignore");

$pdf->render();

$pdf->output(WKPDF::$PDF_DOWNLOAD,$pdf_file_name);

}catch(Exception $e){

die('Exception (line '.$e->getLine().'): '.$e->getMessage());

}

}

?>

doesn't...

<?php

require_once('wkhtmltopdf.php');

$pdf_file_name = "report.pdf";

$URL = $_GET['URL'];

if(isset($URL)){

try {

$pdf=new WKPDF();

$pdf->set_url($URL);

$pdf->args_add("--javascript-delay", "3000");

$pdf->args_add("--zoom", ".7");

$pdf->args_add("--margin-top", "5");

$pdf->args_add("--margin-bottom", "5");

//$pdf->args_add("--lowquality");

$pdf->args_add("--load-error-handling", "ignore");

$pdf->render();

$pdf->output(WKPDF::$PDF_DOWNLOAD,$pdf_file_name);

}catch(Exception $e){

die('Exception (line '.$e->getLine().'): '.$e->getMessage());

}

}

?>

Is there a way to use --lowquality and not get the blank page included?

相关阅读:
Top