Japanese letters disappear in PDF

No matter what options I have tried, I haven’t managed to make mPDF to embed the Sun-Ext* fonts or a subset of it in the pdf file. I only managed to get the font embedded by adding the ‘sun-extb’ value to the ‘font-family’ property in the ‘template.css’ file, but then only the Japanese characters were displayed and all other text was lost, and I presume that’s not what you wanted.

A solution that may work, but I haven’t tested, would be: to create a custom field for the text in Japanese, and then modify a copy of the pdf template to display the custom field using the Japanese font as explained here. The

Another alternative is to process the pdf with a software that embeds the fonts. For instance, you could use the ‘pdftocairo’ tool of the Poppler library (Windows version here) as in,

> pdftocairo -pdf 2018-09-02_Invoice_14.pdf test.pdf

I have tested the tool on GNU/Linux and all fonts where embedded in the new pdf file, which surprisingly was smaller (22K) than the original file (49K) in spite of containing all used fonts,

$ pdffonts test.pdf 
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZLSITS+DejaVuSansCondensed-Bold      TrueType          WinAnsi          yes yes yes      5  0
VYUNIJ+DejaVuSansCondensed           TrueType          WinAnsi          yes yes yes      6  0
NRPACB+XBRiyaz                       CID TrueType      Identity-H       yes yes yes      7  0
GKCFTT+XBRiyaz                       TrueType          WinAnsi          yes yes yes      8  0
SOYXSZ+DroidSansFallback             CID TrueType      Identity-H       yes yes yes      9  0