Wkhtmltopdf icon indicating copy to clipboard operation
Wkhtmltopdf copied to clipboard

WKHTMLTOPDF didn't return any data

Open sevenup30 opened this issue 10 years ago • 5 comments

Hi there, i'm trying to use your classe, but when o use it i do have this error, it create me a html file with my content but say that it do not receive any data :/

here's my code: try { $wkhtmltopdf = new Wkhtmltopdf(array('path' => './public/uploads/')); $wkhtmltopdf->setTitle("Title"); $wkhtmltopdf->setHtml("

coucou
"); $wkhtmltopdf->output(Wkhtmltopdf::MODE_DOWNLOAD, "file.pdf"); } catch (Exception $e) { echo $e->getMessage(); }

i also try with get_page_content, an url always same issue.

Thanks.

sevenup30 avatar Jan 27 '15 10:01 sevenup30

Hello,

The wkhtmltopdf class is hosted here: https://github.com/aur1mas/Wkhtmltopdf

On 01/27/2015 05:00 AM, sevenup30 wrote:

Hi there, i'm trying to use your classe, but when o use it i do have this error, it create me a html file with my content but say that it do not receive any data :/

here's my code: try { $wkhtmltopdf = new Wkhtmltopdf(array('path' => './public/uploads/')); $wkhtmltopdf->setTitle("Title"); $wkhtmltopdf->setHtml("

coucou "); $wkhtmltopdf->output(Wkhtmltopdf::MODE_DOWNLOAD, "file.pdf"); } catch (Exception $e) { echo $e->getMessage(); }

i also try with get_page_content, an url always same issue.

Thanks.

— Reply to this email directly or view it on GitHub https://github.com/aur1mas/Wkhtmltopdf/issues/24.

francoisjacquet avatar Jan 27 '15 14:01 francoisjacquet

"protected $_bin = 'your binary wkhtmltopdf path';"
You must set above line in the class at first.

haibuo1981 avatar Apr 07 '15 05:04 haibuo1981

Check binary file permissions. Usually located here: vendor/nitmedia/wkhtml2pdf/src/Nitmedia/Wkhtml2pdf/lib

CalinB avatar Apr 24 '15 08:04 CalinB

I was able to generate pdf. But, some how it is ignoring the css. If I generate it using terminal then pdf is generated with css. But, somehow it CSS is getting ignored when I try to use the PHP class then PDF is generated with out css. Please guide me

irfnr avatar Jan 15 '16 14:01 irfnr

I have installed the executable in the home folder, I have mentioned correct path to the executable, for example $_bin = '/home/dev/wkhtmltox/bin/wkhtmltopdf' but still i get the error "WKHTMLTOPDF didn't return any data"

rajvanshipradeep15 avatar Jan 31 '17 06:01 rajvanshipradeep15