Announcement

Collapse
No announcement yet.

PDF export is not working

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by daveprue View Post
    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
    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...

    Comment


    • #32
      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.
      /Giuseppe

      Professional Scriptcase Services
      Some Customers opinions

      Comment


      • #33
        Originally posted by Giu View Post
        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.
        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...

        Comment


        • #34
          Hi to all (except john),

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

          Comment


          • #35
            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/t...nsv2pfe47.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
            Last edited by roelof; 09-02-2015, 08:27 AM.

            Comment


            • #36
              @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

              Comment


              • #37
                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
                Last edited by roelof; 09-09-2015, 09:07 AM.

                Comment


                • #38
                  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

                  Comment


                  • #39
                    Originally posted by roelof View Post

                    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.
                    It's in this thread. see my previous messages.

                    Comment


                    • #40
                      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.

                      Originally posted by jcrebel View Post
                      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?

                      Comment


                      • #41
                        I may have found a workaround using SC PDF Export in an SSL-only environment on Linux.
                        Problem: As of SC 8.1.051, SC prefixes the intermediate HTML file URL with http, whether your server is running SSL or not. Even if you insert https in your PDF Server IP, it replaces it with http.(You can see this in action by inspecting the log files created during a PDF export). I also suspect that the old version of the WKHTMLtoPDF library that SC uses may reference a deprecated OpenSSL library. Another reason why the export fails.
                        Solution: Move to the latest WKHTMLtoPDF binary and use web server rewrite rules to redirect http traffic to https.
                        Implementation (for Linux, although the concept should work for other platforms as well):
                        (1) Download a new WKHTMLtoPDF binary (depending on your environment) from here: http://wkhtmltopdf.org/downloads.html (Note: 0.12.3 worked for me)
                        (2) Replace the default SC production library file located at _lib/prod/third/wkhtmltopdf/linux-i386/wkhtmltopdf-i386 (Note: There are different subdirectories for i386, AMD, OSX, WIN, and similar binaries. I have not tested other binaries, so YMMV. I found it safer to just rename the default SC file rather than delete it, although the default SC file did not work for me.)
                        (3) Change the permission of wkhtmltopdf-i386 to 754 (make sure the group and owner are set properly for your environment). (Note: 744 did not work for me. More permissions were not necessary.)
                        (4) Set _lib/tmp folder permissions to 775. (Note: Both intermediate HTML and final PDF files are written here)
                        (5) In your production environment, select Configure Production Environment, and enter the server name instead of an IP address for the field PDF Server IP. For example, sc.mydomain.com.
                        (6) In your Apache or NGINX configuration, you need to create a rule to redirect http traffic to https:. Here are the relevant lines for NGINX:
                        server {
                        listen 80;
                        server_name sc.mydomain.com;
                        return 301 https://$server_name$request_uri;
                        }
                        (7) Restart your server so that the new configuration is used. On Ubuntu, it looks something like this for NGINX: sudo service nginx restart

                        Happy PDF exporting!

                        Comment

                        Working...
                        X