Version: 5
CAUTION
️Version 5 of Gravity PDF does not have full support for Gravity Forms 2.5 and you should consider upgrading to version 6. If you cannot, version 5 will still function but have a degraded admin experience. Support and bug/security fixes will be provided until 27 April 2023.gfpdf_mpdf_post_init_class
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
This filter was introduced in Gravity PDF 5.1.5.
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
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
This filter is located in the Helper_PDF::begin_pdf()
method of /src/helper/Helper_PDF.php
.