PDF export is not working

[QUOTE=robydago;31654]Dave,

why is SC using an http URL and not a local file path? Is there any way to tell SC to use the localpath? That would solve the issue without having to reconfigure apache, right?

[/QUOTE]

I brought this to the attention of NetMake about a year ago. On our web sites, we specifically force https for security reasons, and there is absolutely NO reason for them to force http instead of using the absolute file path.

I have tried for about a year to get them to change this. I finally gave up and we do not use the scriptcase pdf applications at all, we do the tcpdf calls directly.

If you are willing to use http, then the magic word you need is .htaccess

BTW, if you are wondering why we would block http access, check out the rating of our web site: https://www.ssllabs.com/ssltest/analyze.html?d=secure.sahod.ph
versus ScriptCase’s: https://www.ssllabs.com/ssltest/analyze.html?d=www.scriptcase.net

Dave

[QUOTE=daveprue;31656]BTW, if you are wondering why we would block http access, check out the rating of our web site: https://www.ssllabs.com/ssltest/analyze.html?d=secure.sahod.ph
versus ScriptCase’s: https://www.ssllabs.com/ssltest/analyze.html?d=www.scriptcase.net

Dave[/QUOTE]

My keyboard has coffee all over it and my nose hurts.

PDF files get generated using HTTPS and authentication if in apache 2.4 I use this config to allow unauthenticated\HTTP from localhost

alias /cmdb “/var/www/html/prod/cmdb”
<Directory “/var/www/html/prod/cmdb”>
<If “%{REMOTE_ADDR} -ipmatch ‘x.x.x.x’”>
Require local granted
</If>
<Else>
SSLRequireSSL


</Else>
</Directory>

It seems to work only if, as x.x.x.x I use the real IP of the network interface and not 127.0.0.1.
The only issue with this is that the config should be reviewed in cases of migrations\changes of ip addresses.

Btw, I know next to nothing of apache configuration, so maybe someone has a better idea on how to accomplish the same.

I couldn’t live with an IP hardcoded in the apache config.
So I changed it to:


<Directory “/var/www/html/prod/cmdb”>
<If “%{HTTPS} = ‘off’”>
Require local granted
</If>
<Else>
SSLRequireSSL

And it still works: all HTTP requests are accepted from localhost only, so SC is still happy when creating PDF files.

I also noticed if the client is accessing the deployed app via https://servername.domain.com/
SC generates this command line on the server:

./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --header-right “[page]” --javascript-delay 2000 http://servername.domain.com/cmdb/_lib/tmp/sc_g…s4aebsjq3.html /var/www/html/prod/cmdb/_lib/tmp/sc_pdf_20150124132046_127_grid_ci.pdf

This can make PDF not working again when the server is not able to resolve correctly the name used by the client; e.g. if the client is in the public Internet namespace and the server is in a private DMZ.

As SC is changing the original client request from HTTPS to HTTP, maybe it should also change any ‘hostname.domain.tld’ in the HTTP header to ‘localhost’ .

Any feedback on this matter? Mine also have a same problem.

I can’t view the pdf and the downloaded pdf report also cannot be viewed. Do I need to upload the tcpdf to the server to and configure it back in my <prod>/_lib setting page?

No, this bug has been ignored by NetMake for more than a year.

Dave

[QUOTE=daveprue;33302]No, this bug has been ignored by NetMake for more than a year.

Dave[/QUOTE]

Means that it has been fixed or not? Really need help here as my production server has been up and running. The pdf works fine locally (including local separate development server for testing) but the production server is not working. Do I need to configure something in the production environment??

The bug still exists as far as I know.

After several months of waiting and hoping, I changed our site to use TCPDF calls directly, rather than using ScriptCase’s pdf functionality.

Dave

[QUOTE=daveprue;33302]No, this bug has been ignored by NetMake for more than a year.

Dave[/QUOTE]

BUG is whether you can replicate the problem in all situations, or under some specific situations.

AFAIK, PDF export problems are related to permissions.

Giu,

BUG is whether you can replicate the problem in all situations, or under some specific situations.

I appreciate you trying to clarify for me, however my 35 years of managing software development projects has given me a fairly good idea of what a bug is.

If you read the thread, scriptcase is inserting an http:// reference into the wkhtmltopdf input file. This is absolutely wrong. It should be an absolute path. It is a BUG. It does not cause problems for everyone, because some people do not care to use https, but it is repeatable and it is a bug.

AFAIK, PDF export problems are related to permissions.

Many times they are, but that is not what we are talking about.

I reported this bug well over a year ago, and like all the bugs I have reported, have heard nothing back.

Dave

[QUOTE=daveprue;33305]The bug still exists as far as I know.

After several months of waiting and hoping, I changed our site to use TCPDF calls directly, rather than using ScriptCase’s pdf functionality.

Dave[/QUOTE]

Hi Dave,

How to configure the site using TCPDF? I’ve downloaded TCPDF from their site and have no idea to install it. I’ve uploaded the whole TCPDF files to production server and put in into /home/<myservername>/public_html/tcpdf. However, I’ve no idea how to configure it inside the production environment area. Do I need to put it into PDF Server IP field? Is it localhost/tcpdf?

Kindly advise…

Sorry then Dave, didnt readed all the thread…my fault.

Zam2best… Tcpdf is bundled with SC. Sorry to not explain it more…im on mobile right now.

[QUOTE=Giu;33410]Sorry then Dave, didnt readed all the thread…my fault.

Zam2best… Tcpdf is bundled with SC. Sorry to not explain it more…im on mobile right now.[/QUOTE]

Hi Giu,

Yeah its true. TCPDF also included in library and once we deploy the application into production server, it suppose to work as the one that I’ve deployed in development server. Anyway, strangely the export to PDF didn’t work in production server (it works in deployment server). So, i’ve been thinking to use separate TCPDF deployed in seperate folder to solve the issue.

Anyone have done this before? Or is there any other way to solve the export to PDF issue? My application has up and running in production server, so I really need to solve this issue as fast as possible. Thank you in advance…

Hi to all (except john),

Do you have any update on this issue? I am also experiencing the same since I updated my scriptcase.

Hi

I am having the same problem here. I want to have export from sc grid to pdf working on an ssl enviroment. This is what I have tried so far :

  • Yes I am having my _lib/tmp and _lib/prod/third/wkhtmltopdf set to 777 to avoid security issues

  • Yes Java JRE is installed

  • I hired an other shared domain and tried to get the very willing helpdeskers so far to come with a solution. No success…

  • I hired a blade VPS with Linux CentOS.

  • I had to instal libXrender to get it working (this was promped when I tried to run it from the linux bash.

  • In my public_html folder now everything works without SSL fine. But using SSL I moved to private_html folder in the same domain. I am having the same problems.

When I try to export to PDF is says I can view or download. View results in a page not found. In the tmp folder there is no pdf file. The log file and the corresponding html are there.

This is my log :
./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --header-right “[page]” https://www.mydomain.eu/myapp/_lib/tmp/sc_grid_adressen_html_55rlrf2iaq2u15hkinsv2pfe47.html /home/admin/domains/mydomain.eu/private_html/myapp/_lib/tmp/sc_pdf_20150902102307_693_grid_adressen.pdf

As suggested I have run the command from the log file in the linux bash. Wkhtmltopdf results in an Error: Failed loading page. It is suggested to try the – ignore load error option. I tried that and than the pdf is generated. Thats nice, but it does not give me a solution for my problem.

my conclusions :

  • it cannot have anything to do with my application, it works fine without SSL.
  • It cannot have anything to do with my server configuration, because it works fine on the same server without SSL.
  • It cannot have anything to do with my grants, it is the samen in public_html and private_html.

I do not know how to go from here ? Any suggestions. Any help will be highly appreceated.

Greetings.

Roelof

@roelof

Does access to https://www.mydomain.eu requires authentication?

If so and that’s the issue you could try something like what I did on my CentOS box (see my previous posts in this thread).
I don’t think my specific confg would apply to your case (I also had the “HTTPS to HTTP” issue of the older SC version).
but if in the apache config you can differentiate when the request is coming from the pdf generation command line, you should be able to solve your issue.
Note that in the Production environment configuration there’s a “PDF Server IP” setting (blank by default).
I never used it but you could try and see if it can help you in differentiate the request from the normal access to your site, or maybe give you an idea for a different solution to your problem

Hi Robudago,

Thanks for your reply. My domain does not need any authentication other than scriptcase which is an authentication on application level. I have set the value to my prod server enviroment to www.mydomain.eu. I even tried my IP. My VPS is a CentOS box indeed. I installed the latest version wkhmltopdf and all the dependent font packages.

I can run it from SSL with the option load error handing ignore. It did generate a pdf but an empty one, only containing a number 1 but no data. The html looks fine. I cannot find a way to set the ignore option permanently. I do not think it is a good idea to hack my scriptcase code so it will put this option on. My CentOS box runs 3 ip adresses. Two of them are used by SSL domains. I can use wget to load the scriptcase html, i can write from wkhtml to the tmp folder I also checked that. I even replace the links to the css files with full path links and css. wget has no problem with these links. So that cannot be the problemen.

When I run wkhtmltopdf-amd64 https://www.google.com.ph google.pdf the result is perfect. But my scriptcase html was not accepted.

Has anybody a suggestion ?

Robydago can you document this : “apache config you can differentiate when the request is coming from the pdf generation command line”. It is possible apache is the problem here. How did you resolve this ? I googled a lot, but it didn’t help.

Roelof

See if it works for them …
grant permissions to 744 files
_lib / prod / third / wkhtmltopdf / linux-amd64 / wkhtmltopdf-amd64
There I generate PDF from a grid !!!
I guess you have to do the same in cases of i386 on
/ _lib / prod / third / wkhtmltopdf / linux-i386 / i386-wkhtmltopdf

Luis

It’s in this thread. see my previous messages.

What code call is ScriptCase making internally to generate the PDF? If it works on Windows, then it must be a permissions problem of some kind on Linux, or it can’t find
an external utility required to generate the PDF.

[QUOTE=jcrebel;31408]I have the same issue - Linux all rights are correct. PDF never gets generated. It says it does but the file is not in the tmp folder.
I have a windows dev environment and it does works as I have tested it. So anyone else have this issue on Linux? I believe this
could be just a run issue on commercial linux shared hosting systems? - no rights to run a bin from the user account ?

Any ideas?[/QUOTE]