Filter: wr_mpdf_config

Allows you to edit default mpdf config.

 

 

 

Example: Add fonts to pdf builder
add_filter('wr_mpdf_config',  array($this, 'add_fonts') , 10, 1) ;

public function add_fonts($settings) {

		// Add Plugin Font Dir
		$settings['fontDir'] = array_merge($settings['fontDir'], [
			ROOT_DIR . "resources/fonts"
		]);

		// Add Plugin Fonts
		$settings['fontdata'] = $settings['fontDir'] + [
				'futura' => [
					'R' => 'futura_medium_bt.ttf',
					'I' => 'futura_medium_italic.ttf',				]
			];

		return $settings;
	}