Closed PeuX closed 8 years ago
It's probably a limitation of wkhtmltopdf. Have you tried to create the PDF on the command line from a file with the same content?
Yes, and with the same content it generate the right pdf (wifht foo and bar) edit: and with the same command.
Ok, I have no idea then. There's an error code but no error message, which is weird. Personally I don't ever use Windows for Server purposes (and never would :P) for exactly those reasons. Maybe it's an issue with proc_open(). You could play around with it and try if you can run other exe files.
I can run the same command with phpwkhtmltopdf but with option disable-javascript
and it work ...
Weird. There must be some output from wkhtmltopdf - but it's not displayed. So we can only guess what's the real issue.
Did you try javascript-delay?
Yes, but without any success. (i set 'javascript-delay'=>1000
)
Ok, then you're on your own. I would try again to somehow obtain the error message. Read the PHP manual for proc_open() and how to get all outputs (stderr, stdout) and see, if something's there. Also check the error logs of your webserver, maybe something's there.
Have you tried from a command line PHP script? Maybe it prints out the error message there somehow. Also check the return value of proc_close(). Maybe it helps something.
I try to use system() in place of proc_open and it work.
but without any stdout exit ($out=system($command,$returnVal);
)
$out
is empty and $returnVal
is 0$out
still empty and $returnVal
is 1, so i detect error but can't have the reason... sad...(thanks to windows?).So thanks for your time and great work anyway :) bye
Ok, thanks for your report. I'll leave this issue open, just in case there are other windows users with the same problem.
Hi, first great work, thanks :) Now the issu : I try to use phpwkhtmltopdf with somme javascript but i got error with no text error : this is my error :
Could not run command "C:\inetpub\wwwroot\Communication\Appli\script\..\includes\wkhtmltopdf_x64.exe" --encoding "UTF-8" --orientation "Landscape" --margin-bottom "10mm" --margin-top "20mm" --header-spacing "10" "C:\inetpub\wwwroot\Communication\Appli\script\..\..\Donnees\crises\200\upload\temp\1404832841_tmp_file.html" "C:\Windows\Temp\tmp5E63.tmp":
and this is the content of 1404832841_tmp_file.html :
<!DOCTYPE html><html><head></head><BODY><div>foo</div><script type="text/javascript">document.write("bar");</script></BODY></HTML>
if i set the option disable-javascript, it generate the pdf but whithout "bar"
The same command in shell generate pdf.
what i tried get stdout and system() like you said here whitout success :(
If you have some idea... (sorry for my english )...