WKHTMLTOPDF - Where are Scriptcase settings hard-coded?

I am having problems with WKHTMLTOPDF. It just doesn’t work on my host provider. I can manually run a command and get it to work:

wkhtmltopdf --page-size Letter --orientation Portrait --outline-depth 0 --header-right “[page]” file:///home/smp66613/public_html/system/_lib/tmp/sc_grid_glaccts_html_7e3b80edd35d19462dadeee17c9b8a74.html /home/smp66613/public_html/system/_lib/tmp/sc_pdf_20150520193712_829_grid_glaccts.pdf

As you can see though, I have to use the file:// directive for a local absolute path. Scriptcase automatically puts in the http:// directive. Also, because I am running on a shared host, the bundled package in _lib/prod/third/wkhtmltopdf/ gives me a bus error when I try to invoke from terminal.

The hosting provider was kind enough to install WKHTMLTOPDF, globally, on the server. I can run the command above with success, but Scriptcase wants to format it like this, which doesn’t work:

./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --outline-depth 0 --header-right “[page]” http://www.mydomain.com/system/_lib/tmp/sc_grid_glaccts_html_7e3b80edd35d19462dadeee17c9b8a74.html /home/smp66613/public_html/system/_lib/tmp/sc_pdf_20150520193712_829_grid_glaccts.pdf

Is there a file in Scriptcase where these settings are can be changed so that I could hard code which wkhtmltopdf application to look at and to tell Scriptcase to use the file:// directive?

Thanks.

No, there is no way to change those settings.
It’s a big problem that NM is using an absolute path (which is hard to understand) instead of a relative path.
Also if you use SSL (https) it will not work, because it always changes to http. You will find a few posts about this.

jsb

In these kind of cases you can check the generated code and alter the code by hand then. It takes some time to find the right place but I guess that is worth it…
Anyway another solution would be to simply use your own commandline and use the php exec function or the shell_exec function. Since your commandline version works this should also work… (not tested tho).

[QUOTE=jsbinca;36800]
Also if you use SSL (https) it will not work, because it always changes to http. You will find a few posts about this.

jsb[/QUOTE]

Hello,

We fixed this problem with SSL and will be offering in the next update.

Hello,

We need more information.
Whats problem happens?
don’t create the pdf, 404 page not found?
Show some error?


best regard,
netmake team

[QUOTE=Artur Oliveira;36831]Hello,

We need more information.
Whats problem happens?
don’t create the pdf, 404 page not found?
Show some error?


best regard,
netmake team[/QUOTE]

This command fails:

./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --outline-depth 0 --header-right “[page]” http://www.mydomain.com/system/_lib/tmp/sc_grid_invoices_html_7e3b80edd35d19462dadeee17c9b8a74.html /home/smp66613/public_html/system/_lib/tmp/sc_pdf_20150521223507_25_grid_invoices.pdf

This command works using absolute path:

./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --outline-depth 0 --header-right “[page]” /home/smp66613/public_html /system/_lib/tmp/sc_grid_invoices_html_7e3b80edd35d19462dadeee17c9b8a74.html /home/smp66613/public_html/system/_lib/tmp/sc_pdf_20150521223507_25_grid_invoices.pdf

This command works with external websites:

./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --outline-depth 0 --header-right “[page]” http://www.yahoo.com /home/smp66613/public_html/system/_lib/tmp/yahoo_test.pdf

Error I get is:

Failed to load page
Exit with code 1 due to network error: TimeoutError

Is there any update on this topic?
I have no troubles creating PDF, when i run it on my local server.

When trying to create PDF on the Test / Production server (with other URL/Domain), then it says: “PDF generation finished.”, but there is no file at all.
–> Same as described by ‘smp66613

ERROR then is: [h=1]404[/h] [h=2]Not Found[/h] [SIZE=14px]The resource requested could not be found on this server![/SIZE]
In my logfile in _lib/temp, i can see the following:
./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --outline-depth 0 --header-right “[page]” http://www.ossbali-inventory.com/tes1/_lib/tmp/sc_grid_wood_item_single_html_f043d1008d257843f4aab51b86b4e1fc.html /home/ossbalii/public_html/tes1/_lib/tmp/sc_pdf_20160128115749_831_grid_wood_item_single.pdf

Has you write permissions on this folder?

Yes, i have write permissions on that folder. All other Exports are working (Excel, CSV,…). Put the PDF doesn’t work.

about https, mine was complaining about SSLv3
my solution to update wkhtmltopdf…I grabbed the latest version from http://wkhtmltopdf.org/downloads.html

1 Like