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.
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’);
ok, but i use sc in web server , not local server
Hello,
Can you tell me what is the link of your scriptcase?
So, I can see in diagnosis the document root.
Thanks.
Hello,
You can use the path:
/var/www/vhosts/androidintheworld.it/httpdocs/scriptcase/tmp
To generate your pdf files.
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
is right? sc_pdf_output($filename.’/’.$name.’.pdf’);
$name = "my.pdf";
$filename = $_SESSION['scriptcase']['dir_temp'] . '/' . $name;
sc_pdf_output($filename);
Dave