Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.
Gravity PDF v4 will receive security updates and support until October 4, 2019, however it's recommended you upgrade to v5 as soon as practical.
Jump To Section

Description #description

This filter can be used to add or edit settings when a new PDF is created using the GPDFAPI::add_pdf() method. Due to the way the software is architected this filter doesn’t fire when a PDF is created via the UI. See the update PDF filters see gfpdf_form_update_pdf instead.

You also have the option to use the gfpdf_form_add_pdf_$form_id filter.

Parameters #parameters

$pdf | array
The PDF settings
$form_id | integer
The current Gravity Form ID the PDF is being added to

Usage #usage

In this snippet we’re adding a new custom setting to the PDF settings:

add_action( 'gfpdf_form_add_pdf', function( $pdf, $form_id ) {
    $pdf['prefix_custom_setting'] = 'My Custom Setting';
    return $pdf;
}, 10, 2 );

You can also specifically target a form:

add_action( 'gfpdf_form_add_pdf_2', function( $pdf ) { }, 10 );

Source Code #source-code

This filter is located in the Helper_Abstract_Options::add_pdf() method of /src/helper/abstract/Helper_Abstract_Options.php.

Signup for the latest Gravity PDF news, tips and updates

  • This field is for validation purposes and should be left unchanged.
Scroll To Top

Choose your currency:

Converted prices are for reference only - all orders are charged in $ Australian Dollars ($) AUD.
  • AUDAustralian Dollars ($)
  • USDUS Dollars ($)
  • CADCanadian Dollars ($)
  • EUREuros (€)
  • GBPPound Sterling (£)
  • NZDNew Zealand Dollar ($)
  • JPYJapanese Yen (¥)