Announcement

Collapse
No announcement yet.

WKHTMLTOPDF - Where are Scriptcase settings hard-coded?

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

  • 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_7e3b80edd35d19462dadeee17c9b8 a74.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/...17c9b8a74.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.
    Last edited by smp66613; 05-20-2015, 05:30 PM.

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

    Comment


    • #3
      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).

      Comment


      • #4
        Originally posted by jsbinca View Post
        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

        Hello,

        We fixed this problem with SSL and will be offering in the next update.
        Best Regards,
        John L. Santos

        Bug Tracker Team
        NetMake - IT Solutions

        Comment


        • #5
          Hello,

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

          --
          best regard,
          netmake team

          Comment


          • #6
            Originally posted by Artur Oliveira View Post
            Hello,

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

            --
            best regard,
            netmake team
            This command fails:

            ./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --outline-depth 0 --header-right "[page]" http://www.mydomain.com/system/_lib/...17c9b8a74.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_7e3b80edd35d19462dadeee17c9b 8a74.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

            Comment


            • #7
              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: 404

              Not Found

              The resource requested could not be found on this server!
              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/tes...b86b4e1fc.html /home/ossbalii/public_html/tes1/_lib/tmp/sc_pdf_20160128115749_831_grid_wood_item_single.pd f

              Comment


              • #8
                Has you write permissions on this folder?
                /Giuseppe

                Professional Scriptcase Services
                Some Customers opinions

                Comment


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

                  Comment


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

                    Comment

                    Working...
                    X