Resolving Font Issues

To keep the PDF Generator Extensions installation zip as small as possible a number of fonts had to be omitted from the included mPDF package, font files can be extremely large. 

If you find that the generated PDF is missing some characters or the file won't generate it is most likely due to a missing font. You may find a note in the entry timeline like this:

Error: Unable to generate PDF. mPDF Error - cannot find TTF TrueType font file - /app/public/wp-content/plugins/gravityflowpdf/includes/mpdf/ttfonts/Sun-ExtA.ttf

To resolve this issue you can create a custom fonts directory in another location, such as the wp-content directory. The missing font file(s) which can be downloaded from the mPDF GitHub repository can then be added to your custom fonts directory. Using a custom fonts directory outside the plugins directory ensures your changes will not be lost during plugin updates.

For issues with Chinese, Japanese, and Korean languages you would need the  Sun-ExtA.ttf file.

Once you have added the missing font(s) to a custom location you can then use the hook  gravityflowpdf_mpdf to specify the folder of the custom font

add_filter( 'gravityflowpdf_mpdf', 'gravityflow_mpf_custom_fonts', 10, 5 );
function gravityflow_mpf_custom_fonts( $mpdf, $body, $file_path, $entry, $step ) {
    $mpdf->AddFontDirectory( dirname(__FILE__) . '/wp-content/folder_name_here/' );
    return $mpdf;
}

Now you can then restart the step to generate the PDF and continue the workflow.