cancel
Showing results for 
Search instead for 
Did you mean: 

Invoice Print PDF of admin does not support the Chinese language?

Invoice Print PDF of admin does not support the Chinese language?

Invoice Print PDF of admin does not support the Chinese language?


How to Fix this issue?

If you have any idea then reply.

Thank you.

3 REPLIES 3

Re: Invoice Print PDF of admin does not support the Chinese language?

In the past, we came across the same situation where we faced issue with the regional font. To fix it we have overridden pdf invoice file and simply changed the default invoice pdf font and it worked for us. Considering that you can try such solution by changing invoice font, maybe it will work for you.Smiley Happy

 

Firstly, you need to add following code to your extension config file.
Available at : app\code\Namespace\Extensinoname\etc\config.xml

<models>
	   <pdffont>
		<class>Namespace_Extension_Model</class>
	</pdffont>
	<sales>
                		<rewrite>
                   		<order_pdf_invoice>Namespace_Extension_Model_Order_Pdf_Invoice</order_pdf_invoice>
                    	<order_pdf_items_invoice_default>Namespace_Extension_Model_Order_Pdf_Items_Invoice_Default</order_pdf_items_invoice_default>
		</rewrite>
            	</sales>
</models>

After that add TTF font to your root library if needed.
like this : root/lib/font_name.ttf

 

Once you are done, Lastly you have to implement that font in your 'invoice.php' file.
Available at : app\code\Namespace\Extensinoname\Model\Order\Pdf\Invoice.php

protected function _setFontRegular($object, $size = 6)
{
$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/font_name.ttf');
$object->setFont($font, $size);
return $font;
}
Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

Re: Invoice Print PDF of admin does not support the Chinese language?

Thanks for the sharing. I got the same issue and would try out your suggestion. :-)

Re: Invoice Print PDF of admin does not support the Chinese language?

We already set the font with TTF file but set the wrong font family. 

Now working fine. thanks, @theMageComp for the reply.