Save PDF file to folder

RSForm!Pro generated PDF files can be saved to your server with the help of custom scripting. In order to do so, a similar as the following script is needed within 'Script called after form has been processed' area:

 
list($replace, $with) = RSFormProHelper::getReplacements($SubmissionId);
$pdfUser = str_replace($replace, $with, '{user_pdf}');
$pdfAdmin = str_replace($replace, $with, '{admin_pdf}');
 
//destination path for the User PDF file:
$pdfUserfile = JPATH_SITE.'/tmp/pdf-user-'.$SubmissionId.'.pdf';
 
//destination path for the Admin PDF file:
$pdfAdminfile = JPATH_SITE.'/tmp/pdf-admin-'.$SubmissionId.'.pdf';
 
copy($pdfUser,$pdfUserfile);
copy($pdfAdmin,$pdfAdminfile);
 
Note:
  • The script is added within backend > Components > RSForm!Pro > Manage Forms > your form > Properties > PHP Scripts > Script called after form has been processed.
  • $SubmissionId is added as the file name in order to prevent file overwriting and to provide a correlation with the actual submission.
  • More information on RSForm!Pro PHP Scripts can be found here.

5 persons found this article helpful.


Was this article helpful?

Yes No
Sorry about that

You Should Also Read

Plugin - PDF (Attach an automatically generated PDF to an email) HOT

PHP PDF Pre-Processing Scripts

Improving the PDF export for submissions

PDF plugin - tips and tricks

Using the {if} statement with RSForm!Pro PDF plugin