[SOLVED]SC9 pdf export does not work for https

REPOSTING THIS TOPIC IN BUGS:

I recently migrated my site to use SSL, the pdf exports have stopped working.
It is opening the URL as HTTP not HTTPS. Changing the “[SIZE=12px]PDF Server IP”[/SIZE] setting to include “https://” in the production setup “https://yoursite/_lib” for pdf exports does not fix the problem

The log file created in the /_lib/tmp directory shows the problem:
./wkhtmltopdf-amd64 --page-size Letter --orientation Landscape --header-right “[page]” http://myhost.mydomain

This is the exact same Bug reported for SC8:
http://www.scriptcase.net/forum/foru…ror-with-https

Netmake please FIX this BUG.

it Looks like in the index.php of an application that exports to pdf you explicitly replace https with http ?

$arq_pdf_in = str_replace(“https://”, “http://”, $arq_pdf_in);

After changing the code the exports works over https and the logfile reflects the correct URL:
./wkhtmltopdf-amd64 --page-size Letter --orientation Landscape --header-right “[page]” https://myhost.mydoamin

not sure if wkhtmltopdf support https, i did changed the source code to https, pdf file is generated but the content is not right.
So i changed pdf server ip on production environment setting to http://localhost for workaround.
For security purpose, i only bind port 80 to localhost.

Regards,
Heince

Cool Thanks for the reply I will give it a bash,
My understanding is that wkhtmltopdf supports SSL, maybe this is legacy Netmake code to compensate for when it didnt.

My production server does not have a virtual host for localhost or port 80 for that matter, It only uses ssl https… , might be a workaround for someone else.

I’ve been having the same problem, and am wondering why wkhtmltopdf is used in SC9…??? It’s bloated, seems to be maintained a lot less than it used to, and there are more active (and leaner?) conversion tools out there. I’m thinking of phantom-html2pdf as one idea…

Netmake would better do without wkhtmltopdf and use a better tool.
Unfortunately, I have to do without the pdf export. What can be so difficult. My provider refuses to install the necessary tools for this.

Hola , llevan a?os con el tema del pdf en https y nunca dan respuesta. Es una verguenza, la gente paga por scriptcase, y cosas que son basicas dan problemas. No intentar que la gente paque soporte para solucionar cosas que deberian ir bien desde un principio. Si poneis la opci?n de PDF, no es problema del cliente que este en http o en https, o la libreria que utiliceis, tiene que funcionar independiente del cliente, sino no ofrecer la opcion de pdf y que el desarrollador o cliente se busque la vida.

Hello, they have been with the subject of the pdf in https for years and never give an answer. It’s a shame, people pay for scriptcase, and things that are basic give problems. Do not try to get people to support them to solve things that should be good from the beginning. If you put the option of PDF, it is not problem of the client that this in http or in https, or the library that you use, it has to function independent of the client, but not to offer the option of pdf and that the developer or client seeks life .

now, i have asked a lot of providers, no one supports the wkhtmltopdf. how can scriptcase use a thirdparty tool, that was not supported from any providers on the world. i remember me, that “sql meastro” use an other pdf tool. So this is not a technical problem to generate pdf’s from grids. its only a question witch tool scriptcase uses.

Well i saw in some of the latest patches this bug was supposedly fixed… If you delve deeper into how Scriptcase works you’ll discover how many third party tools it actually uses @!!

Hello,

This problem has been solved in 9.0.015.

  • Fixed PDF export issue in environments that only accept the https:// protocol.

http://www.scriptcase.net/scriptcase-changelog/

I have not pushed code to production since I made custom changes to your code, I will report back as soon as I do.

I can confirm that the problem was solved in 9.0.015.

Hello,
I read that with version 9.0.015 export pdf bug via http was solved/fixed.
Sadly, I get message “Error 404” again.
Kindly, someone can say me whatt settings should be included, in the production environment, in the PDF Server IP entry.

Thank you !!
Mauro

Mauro, My Production server IP entry is in the format https://myhost.mydomain

Please check the logs as mentioned in my first post to see what URL is used by wkhtmltopdf on your server.

I think that when I changed it to my server IP address, wkhtmltopdf used the IP which was not compatible with my production server settings, as the IP is not used in my Apache server’s virtual hosts configuration.

Thus in conclusion the URL/IP entry in the Production server settings must be a reachable URL.

I had the same problem. (I also had it on v8.1 and never had time to resolve it till now).

I basically ran the export, checked the server error logs and found a permissions error. I fixed that and repeated the test. Again I found another permissions error. In my case it was phantomjs.

[SIZE=14px]1. checked permission on wkhtmltopdf-amd64 and set it to allow execute (744)[/SIZE]
[SIZE=14px]2. Found that .phantomjs was not set to execute and again set the CHMOD to 744[/SIZE]
[SIZE=14px]This appears to have done the trick and I can now generate pdfs from the prod environment again.

Both of these files are subdirectories of -lib/prod/third/
for example -lib/prod/third/phantomjs/linux-amd64/phantomjs

I hope this helps

Ian[/SIZE]

I think this topic can be closed.

How do you solve for a pdf when the connection is by https?

I double plus one that. Have exactly the same issue on a couple of virtual hosts running one of my SC projects.

Hi everybody,

I’ve the same problem in Scriptcase version 9.3.0.10., which inernally use wkhtmltopdf version 0.12.4, which doesn’t support https/SSL.
…/_lib/prod/third/wkhtmltopdf/linux-amd64/wkhtmltopdf-amd64.

Https / SSL is supported in wkhtmltopdf-amd64 ver 0.12.5.
(by https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3001).

The solution is to replace the original executable file/_lib/prod/third/wkhtmltopdf/linux-amd64/wkhtmltopdf-amd64 version 0.12.4 with the new executable file wkhtmltopdf-amd64 version 0.12.5, which is available at https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
resp. https://wkhtmltopdf.org/downloads.html.
The approach:

  1. Download the package https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb (or another distribution / platform)

  2. Extract /CONTENTS/usr/local/bin/wkhtmltopdf from wkhtmltox_0.12.5-1.bionic_amd64.deb to the local file

  3. Rename wkhtmltopdf to wkhtmltopdf-amd64

  4. Copy / rewrite original file /_lib/prod/third/wkhtmltopdf/linux-amd64/wkhtmltopdf-amd64 by the new one.

  5. Check if the owner user / group is the apache user / group and if the execution permission is set.

Regards

Rick

Hello, I have the last one and it DOES NOT WORK in production. This problem and I can not offer customers this option.

RECIEN ACTUALIZADA Y TAMPOCO SE PUEDE GENERA APLICACIONES DA ERROR:

Fatal error: Class ‘nmDados’ not found in C:\Program Files\NetMake\v9\wwwroot\scriptcase\devel\class\generator\nmDadosForm.class.php on line 21

Greetings.