• Hello… thanks in advance for any help…

    So I have made a large form with Ninja Forms, and a custom PDF template… I copied it need to alter the form and custom PDF template for the slightly different form. I had done a little reading on this and found this piece of advise:

    PDF Templates for Each Form

    Some people want to have PDF templates for each form. The best way to achieve this is to use one template and use some conditional logic within the template using the $form_ID variable to display different templates.

    I was wondering if someone might be able to provide an example of how this would look?

    Here is what the start of my custom PDF Export code looks likes

    <?php
    /**
    * PDF Included With Form Submission
    *
    * @author Patrick Rauland
    * @version 1.0.0
    */

    if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly

    ?>
    <html>
    <head>
    <link type=”text/css” href=”pdf.css” rel=”stylesheet” />
    </head>
    <body>

    <header>
    <img src=”https://kscsafety.com/wp-content/uploads/2015/11/site-logo.png”/&gt;
    </header>

    <div id=”main”>

    <div><!– General Info –>
    <h1>Site-Specific Safety and Health Plan (SSSP) for project:</h1>

    <p>Please complete this and the following 24 sections to begin the development of your Site Specific Safety Plan. Please save your information as you work through the process. You can stop and restart at any page.</p>
    <table width=”100%” cellspacing=”5″ cellpadding=”5″>
    <tr>
    <td width=”25%” align=”right”><p><b>Project Title:</b> </p></td>
    <td width=”25%” align=”left”><p><?php echo $fields[11][‘value’];?> </p></td>
    <td width=”25%” align=”right”><p><b>PCN:</b> </p></td>
    <td width=”25%” align=”left”><p><?php echo $fields[12][‘value’];?> </p></td>
    </tr>
    </table>

    <table width=”100%” cellspacing=”5″ cellpadding=”5″>
    <tr>
    <td width=”25%” align=”right”><p><b>Contract Number:</b> </p></td>
    <td width=”25%” align=”left”><p><?php echo $fields[13][‘value’];?> </p></td>
    <td width=”25%” align=”right”><p><b>Company Name:</b> </p></td>
    <td width=”25%” align=”left”><p><?php echo $fields[14][‘value’];?> </p></td>
    </tr>
    </table>

Viewing 1 replies (of 1 total)
  • hi
    i know this is a very old thread now but im having a similar issue and i simply can’t find the error

    i have a ninja form and one field has a field key of “full name”

    I had the pdf submissions plug in. It works – and i can add images to the template which is great.
    However- i simply cannot get single field to be displayed.
    ive tried

    echo $fields[“fullname”][‘value’];

    echo $fields{“full name”}[‘value’];

    echo $fields[‘fullname’];

    echo $fields[‘fullname’][‘value’]

    and almost all other combinations!!

    have you been able to get this to work?

    many thanks in advance

    billy

Viewing 1 replies (of 1 total)
  • The topic ‘Ninja Froms Custom PDF Template’ is closed to new replies.