Error generation pdf

Hi, I have a procedure generated with SC 9.4.031. From a grid export to pdf. Everything works, the bar comes to tell me “PDF generation finished.” However, when I go to view the file the server replies with “File not found”.

In fact looking at the log of the tmp folder I see that the following command is generated:
./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --header-right “[page]” no link please: www.xxx.it / yyy / lib / tmp / sc_grid … 1qb10.html / home / mhd-01 / www.xxx.it / htdocs / yyy / _lib / tmp / sc_pdf_2 … _ occupied.pdf

my opinion is that the command created tries to store the pdf generated in / home / mhd-01 … which is NOT the folder indicated in the Production Environment. The set folder is (see attached pdf):
/ Home / mhd …
I don’t understand how it generates mhd-01 and not mhd.
2020-06-26_181037.zip (33.2 KB)

I have been unable to make Grid > Export > PDF work in my environment. It works on the local machine but not when run from elsewhere (I do development from my home office). Although I don’t have a solution, my analysis is that it is a permissions issue. The SC code creates an html file and log file and then wkhtmltopdf (which is the program used by SC) converts the html file into a PDF. Everything works until that point. My best guess is that it (wkhtmltopdf) does not have permission to write to the folder. I am on windows and have tried everything to make it work without success. Permissions on the folder, run as administrator, compatibility mode … haven’t found it yet. SC people tried to figure it out too … no solution. They told me to make sure I have C++ 2015 Redistributable installed on the server; and I do. I even uninstalled and reinstalled. I’ve seen others, on Linux, have set permissions to 777. I don’t have a clue … but I am curious if you find an answer.

i faced the same problem. its a bug in scriptcase for version 9. the problem is with the wkhtmltopdf program itself.
i fixed it by downloading wkhtmltopdf from third party website (u can download the version according to your OS) and replaced the wkhtmltopdf program in the scriptcase folder where the program is located (/third/prod/…) in your production environment.
you need to copy and teplace into your development environment too, so when next time you deploy the application, it will copy the right wkhtmltopdf to your production environment.
Scriptcase will replace the wkhtmltopdf program in the third/prod/ folder once you download and install scriptcase for updates. then, you have to copy and replace back the working wkhtmltopdf into the development environment folder.
hope it helps.
Scriptcase, plesde fix this wkhtmltopdf bugs.

i had this problem in my 64 bit Linux server. That used to be an issue of wkhtmltopdf executable. As zamaniusj said i used to replace my original wkhtmltopdf which was working. Howver SC has fixed this issue in 9.3x.

The following are the places to look at

  1. Go to SC Production and set the PDF Server path with full path of your server
  2. go to _lib\tmp and provide 777 rights
  3. go to _lib/prod/third/wkhtmltopdf/linux-amd64 and ensure that this has execute permission for public

if the problem does not resolve then go to your terminal and then navigate to

_lib/prod/third/wkhtmltopdf/linux-amd64

and then run the command from the log file which is available in the _lib\tmp folder

which will be similar like

./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --header-right “[page]” no link please: www.xxx.it / yyy / lib / tmp / sc_grid … 1qb10.html / home / mhd-01 / www.xxx.it / htdocs / yyy / _lib / tmp / sc_pdf_2 … _ occupied.pdf

now you will see what is the error shown in the terminal. This will give you a clue. Most of the time this will be a permission issue. Otherwise you need to download the wkhtmltopdf-amd64 from external site and place them in this folder and try to run.

I had the same problem when posting to the server.
Finally I solved it through the panel of my hosting.
By default and for greater security, several options were disabled in custom httpd.
What I did is modify them and it worked.

Before:
php_admin_value [disable_functions] = show_source, system, exec, shell_exec, passthru, exec, popen, proc_open, proc_close, allow_url_fopen, ini_set, escapeshellarg, escapeshellcmd, dl, curl_multi_exec, phpinfo

After:
php_admin_value [disable_functions] =

Fixed by downloading a new wkhtmltopdf binary from their website and updating the copy in the production environment.

1 Like

the name of the file in the production environment is ‘wkhtmltopdf-amd64’ (seems to be a parameter but not), while the download binary is just ‘wkhtmltopdf’, ¿should I rename it?. Thanks.