Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.
This is the legacy Gravity PDF v4 documentation which is NOT supported. Go to the latest documentation.
Jump To Section

Description #description

This method will return an array containing all the PDFs configured on a particular Gravity Form. If you want an individual PDF settings see GPDFAPI::get_pdf().

Version #version

This method was introduced in Gravity PDF 4.0.

Parameters #parameters

$form_id | integer
The Gravity Form ID

Return #return

array | WP_Error
An array of the PDFs will be returned on success, otherwise a WP_Error object on failure

Usage #usage

This snippet will show you how to get the current list of PDFs setup on a particular Gravity Form and loop through the results:

add_action( 'init', function() {
    if ( class_exists( 'GPDFAPI' ) ) {

        /* Get a list of PDFs assigned to form #2 */
        $pdfs  = GPDFAPI::get_form_pdfs( 2 );

        if ( ! is_wp_error( $pdfs ) && sizeof( $pdfs ) > 0 ) {
            echo '<ul>';

            /* Loop through and output the PDF name field in a list */
            foreach ( $pdfs as $pdf ) {
                echo '<li>' . $pdf['name'] . '</li>';

            echo '</ul>';
} );

Source Code #source-code

This method is located in api.php.

Signup for the latest Gravity PDF news, tips and updates

  • This field is for validation purposes and should be left unchanged.
Gravity PDF 40K Active Installs Celebration! Take 20% off any products with coupon 40KMILESTONE (this week only)Visit Store
+ +
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 (¥)