PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

pdf certificate generation

  1. Hi,
    I'm trying to generate a user specific pdf certificate once a form has been completed.

    I understand (from reading "PDF Generation Add-On" topic) that using the (?action) hook 'gform_after_submission' will access my form data at the right point to pull the data out.

    I'm trying to figure out how to pull the data out!
    Would the basic code be something like:

    <?php
    do_action ( 'gform_after_submission', $function_get_my_data_out )
    ?>

    Then send the data in array form to the pdf generator.

    - is there anyone out there who knows how to do this?

    Grateful for any help.

    Posted 13 years ago on Monday December 12, 2011 | Permalink
  2. Hi fr35ht,

    Here is some documentation on the gform_after_submission hook and what data is available to this hook:

    http://www.gravityhelp.com/documentation/page/Gform_after_submission

    After you've read through the documentation, let me know if you have any other questions. :)

    Posted 13 years ago on Monday December 12, 2011 | Permalink
  3. Very helpful, thank you David.
    A quick question:
    Can I clarify that "entry creation" mentioned in the link means that the data has been entered into the relevant SQL database? In other words the form input has been saved in the database by the time the hook 'form_after_submission' is called?

    Posted 13 years ago on Tuesday December 13, 2011 | Permalink
  4. Yes, and yes. The entry has been created, which means it is in the database and you can access it with the gform_after_submission hook.

    Posted 13 years ago on Tuesday December 13, 2011 | Permalink
  5. Great thanks for the speedy reply Chris,
    From following the previous reply links, I understand that the form data can be accessed via the $entry object.
    So my guess for the syntax would be:

    add_action ('gform_after_submission' , array ( 'className' , 'methodName' ) ;

    or more specifically:

    add_action ('gform_after_submission_my_form_id', array ( '$entry', 'method_pull_out_my_data' )) ;
      function ('method_pull_out_my_data) ;

    Does that look about right?

    Posted 13 years ago on Wednesday December 14, 2011 | Permalink