Support Log in

54. PDF Template Customization

Developer Guide
Prefer video? Watch the Fillin Forge tutorials 9 short guides covering every feature Watch

Fillin Forge builds the PDF of a submission itself, with one fixed layout. There is no template to customize and no hook for it.

How the PDF is made

The Submissions screen links to admin-ajax.php?action=formforge_download_pdf with the form id, the submission id and a nonce. Only users with manage_options can use it. Fillin Forge sends the label and the text value of each field, without the internal keys that start with an underscore, to the Forge API and asks for its basic template. The payment details of the submission are added as extra rows.

If the Forge API returns no PDF, or the add-on that provides it is not installed, Fillin Forge builds a plain PDF itself. Either way the download is named submission-{id}.pdf.

What you cannot change

The layout, header and footer of the PDF cannot be changed in code. The notification email cannot be changed or get an attachment either (see Notification Filters).

Making your own PDF

To produce a different document, build it yourself from the submission event with the PDF library of your choice:

php
add_action( 'formforge/submission_created', function ( $submission_id, $payload ) {
    $lines = [ $payload['form_title'] ];
    foreach ( $payload['fields'] as $key => $value ) {
        $lines[] = $key . ': ' . $value;
    }
    // pass $lines to the PDF library you use
}, 10, 2 );
Forge AI Assistant Online

Hi! I'm the Fillin Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs