If you use the PDF Invoices & Packing Slips for WooCommerce plugin to generate order invoices, you may notice that certain currency symbols โ such as โด, โธ, โบ, โฝ, โฌ and others โ appear as blank boxes or question marks in the generated PDF files.
๐ Why Does This Happen?
PDF generation libraries (DomPDF and mPDF, both used by this plugin) rely on fonts that are embedded into the PDF. The default font used by these libraries does not include glyphs for many international currency symbols. As a result, those characters simply cannot be rendered and appear broken.
The fix is to force the PDF engine to use DejaVu Sans โ a font with broad Unicode coverage that includes virtually all currency symbols used worldwide.
โ The Fix
Add the following code to your theme’s functions.php file or to a site-specific plugin.
Step 1: Add the code
// Fix currency symbols in PDF invoices (PDF Invoices & Packing Slips for WooCommerce).
// Forces DejaVu Sans font which has full Unicode currency symbol coverage.
add_action('wpo_wcpdf_before_document', function() {
echo '<style>body, * { font-family: dejavu sans, sans-serif !important; }</style>';
});
add_filter('wpo_wcpdf_dompdf_options', function($options) {
$options['defaultFont'] = 'DejaVuSans';
return $options;
});
add_filter('wpo_wcpdf_mpdf_font_data', function($font_data) {
$font_data['dejavusans'] = [
'R' => 'DejaVuSans.ttf',
'B' => 'DejaVuSans-Bold.ttf',
'I' => 'DejaVuSans-Oblique.ttf',
'BI' => 'DejaVuSans-BoldOblique.ttf',
];
return $font_data;
});
Step 2: Upload the DejaVu Sans font files
The font files must be available on your server. Download DejaVu Sans (free, open source) and upload the following four files to your server โ for example into your theme folder or a dedicated fonts directory:
DejaVuSans.ttf
DejaVuSans-Bold.ttf
DejaVuSans-Oblique.ttf
DejaVuSans-BoldOblique.ttf
๐ก Where to get the font: Download from dejavu-fonts.github.io โ it is completely free and open source.
๐ก Note on mPDF: If you are using mPDF as your PDF engine, update the file paths in the wpo_wcpdf_mpdf_font_data filter to match the actual location of the font files on your server.
๐ง Which PDF Engine Are You Using?
The plugin supports two PDF rendering engines:
| Engine | Hook that applies |
|---|---|
| DomPDF (default) | wpo_wcpdf_dompdf_options + wpo_wcpdf_before_document |
| mPDF | wpo_wcpdf_mpdf_font_data + wpo_wcpdf_before_document |
The code above covers both engines โ you can safely add all three hooks regardless of which engine is active.
โ Symbols Fixed by This Solution
After applying the fix, the following currency symbols (and many more) will render correctly in your PDF invoices:
| Symbol | Currency |
|---|---|
| โด | Ukrainian hryvnia |
| โธ | Kazakhstani tenge |
| โบ | Turkish lira |
| โฝ | Russian ruble |
| โฌ | Euro |
| ยฃ | British pound |
| ยฅ | Japanese yen / Chinese yuan |
| โฉ | South Korean won |
| โซ | Vietnamese dong |
โ ๏ธ Important Notes
- This fix applies only to PDFs generated by PDF Invoices & Packing Slips for WooCommerce
- It does not affect the appearance of your WooCommerce store frontend
- If you switch PDF engines inside the plugin settings, the fix continues to work โ all three hooks are covered
- After adding the code, regenerate an existing invoice to confirm the symbols now render correctly