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

Gravity PDF includes a global stylesheet which applies to all PDFs. This filter allows you to remove the product table styles for all or some of your PDFs.

Parameters #parameters

$active | boolean
Whether to show or remove the default product table styles
$settings | array
The current PDF settings being processed.

Usage #usage

This snippet shows you how to display the default product table CSS for all PDFs:

add_filter( 'gfpdf_include_product_styles', function( $active, $settings ) {
    return false;
}, 10, 2 );

This snippet shows you how to display the default product table CSS for a particular PDF:

add_filter( 'gfpdf_include_product_styles', function( $active, $settings ) {

    /* Display the list field styles for a specific PDF */
    if ( '51281289afj212' == $settings['id'] ) {
        $active = false;
    }

    return $active;
}, 10, 2 );

Source Code #source-code

This filter is located in the /src/view/html/PDF/core_template_styles.php file.

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:

Close
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 (¥)