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

In order to use the {if} statement within the RSForm!Pro generated PDF files, you'll have to use one of the following scripts. There are two cases for creating the PDF layout, both explained below.


  1. If you have configured the PDF file for the User Email:
  2. Head to backend > Components > RSForm!Pro > Manage Forms > edit your form > Properties > PHP PDF Pre-Processing Scripts > 'User Email Pre-processing PHP Script' area and add the following code:

     
    require_once(JPATH_ADMINISTRATOR.'/components/com_rsform/helpers/scripting.php');
    RSFormProScripting::compile($info->useremail_layout, $args['placeholders'], $args['values']);
     
  3. If you have configured the PDF file for the Admin Email:
  4. Head to backend > Components > RSForm!Pro > Manage Forms > edit your form > Properties > PHP PDF Pre-Processing Scripts > 'Admin Email Pre-processing PHP Script' area and add the following code:

     
    require_once(JPATH_ADMINISTRATOR.'/components/com_rsform/helpers/scripting.php');
    RSFormProScripting::compile($info->adminemail_layout, $args['placeholders'], $args['values']);
     
    Example:

    Now you can simply use a syntax similar to the following:{if {fieldname:value}} {fieldname:caption}:{fieldname:value} {/if}


    8 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

    Save PDF file to folder