gravityflowpdf_mpdf

Description

The gravityflowpdf_mpdf filter is used to customize the mPDF instance, which will be used to generate the PDF based on the template (defined in step settings) and entry field values. Refer to https://mpdf.github.io/reference/mpdf-variables/overview.html for more details on configuration options.

Parameters

ParameterTypeDetails
$mpdfArrayThe mPDF instance which the PDF will be generated through
$bodyStringThe PDF content
$file_pathStringThe PDF path
$entryEntryThe Entry object
$stepStepThe workflow step

Examples

1
2
3
4
5
6
7
8
9
10
add_filter( 'gravityflowpdf_mpdf', 'gravityflow_filter_gravityflowpdf_mpdf', 10, 5 );
    function gravityflow_filter_gravityflowpdf_mpdf( $mpdf, $body, $file_path, $entry, $step ) {
        // modify $mpdf properties
        $mpdf->SetProtection(array());
        $mpdf->setFooter('{PAGENO}');
        $mpdf->setHeader('{PAGENO}');
        $mpdf->SetWatermarkText('Gravity Flow');
        $mpdf->showWatermarkText = true;
        return $mpdf;
    }

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?