Announcement

Collapse
No announcement yet.

pdf output

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

  • pdf output

    Using, sc_pdf_output ('invoice -'. Numero_fattura {}. '. Pdf');
    I can get in saving the pdf name I chose, I would like to adapt the code to save the pdf file or on the server or locally so as to have an attachment to send with macro scriptcse.

  • #2
    Hello,

    You need to put the complete path to generate the file like below:
    [path] = '/opt/Netmake/v8/wwwroot/scriptcase/tmp';
    [file_name] = 'my_pdf';

    sc_pdf_output([path].'/'.[file_name].'.pdf');
    --
    ScriptCase Team

    Comment


    • #3
      ok, but i use sc in web server , not local server

      Comment


      • #4
        Hello,

        Can you tell me what is the link of your scriptcase?
        So, I can see in diagnosis the document root.
        Thanks.
        --
        ScriptCase Team

        Comment


        • #5
          http://androidintheworld.it/scriptcase/diagnosis.php

          Comment


          • #6
            Hello,

            You can use the path:
            /var/www/vhosts/androidintheworld.it/httpdocs/scriptcase/tmp
            To generate your pdf files.
            --
            ScriptCase Team

            Comment


            • #7
              Andrea,

              It is bad practice to hard-coded paths.

              You are much better off using:

              $name = "my.pdf";
              $filename = $_SESSION['scriptcase']['dir_temp'] . '/' . $name;

              Since this will work in both development and production environments.

              In addition, should you move your production path, or maybe install on another server, it will continue to work.
              If you export your project and import it into scriptcase on a different machine, it will continue to work.

              Dave
              Last edited by daveprue; 12-01-2014, 09:04 AM.
              Dave Prue
              Code Whisperer
              Lahar International Corp
              www.lahar.net

              Comment


              • #8
                is right? sc_pdf_output($filename.'/'.$name.'.pdf');

                Comment


                • #9
                  Code:
                  $name = "my.pdf";
                  $filename = $_SESSION['scriptcase']['dir_temp'] . '/' . $name;
                  sc_pdf_output($filename);
                  Dave
                  Dave Prue
                  Code Whisperer
                  Lahar International Corp
                  www.lahar.net

                  Comment

                  Working...
                  X