Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.
Jump To Section

Description #description

This filter can be used to modify the mPDF settings before any HTML has been processed, but after Gravity PDF sets up the initial object.

Version #version

This filter was introduced in Gravity PDF 5.1.5.

Parameters #parameters

$mpdf | object
The initialised mPDF class that handles the PDF generation
$form | array
The current Gravity Form array
$entry | array
The raw Gravity Form Entry array.
$settings | array
The current PDF settings being processed
$Helper_PDF | object
The initialised \GFPDF\Helper\Helper_PDF class

Usage #usage

Use this filter to override any of the Gravity PDF default mPDF settings.

Below is a snippet to override the text direction in mPDF:

add_filter( 'gfpdf_mpdf_init_class', function( $mpdf, $form, $entry, $settings, $Helper_PDF ) {
    $mpdf->SetDirectionality( 'ltr' );

    return $mpdf;
}, 10, 5 );

Source Code #source-code

This filter is located in the Helper_PDF::begin_pdf() method of /src/helper/Helper_PDF.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:

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