9

is properly displaying in front pages as well as product pages. But it is not displaying properly in pdf of invoice and shipment. How to change for proper displaying.

I have tried changing in lib/zend/locale/data/root.xml and also in admin/system/manage currency/symbols ,but no changes updating in pdf's.

enter image description here

2 Answers 2

4

1.Download the font that support Indian Rupee symbol. recommended dejavu-sans font.

2.place the font in lib directory.

3.open app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php and app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php

and replace

$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Re-4.4.1.ttf');

with

$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/dejavu-sans/DejaVuSans.ttf');

(in _setFontRegular(), _setFontBold(), _setFontItalic() functions in both files.)
16
  • 1
    I don want to change in core files, to avoid conflict in other files
    – rashmi sm
    Oct 28, 2015 at 7:49
  • then the default font does not support Indian currency symbol. Oct 28, 2015 at 7:55
  • Yes, but how to resolve it without core files
    – rashmi sm
    Oct 28, 2015 at 7:56
  • 1
    copy into local directory and change it there.. Oct 28, 2015 at 7:56
  • i have copied the directory Pdf from core and pasted in app/code/local/Mage/Sales/Model/Order............... and changed both abstarct.php. but no changes
    – rashmi sm
    Oct 28, 2015 at 8:02
3

Thank you for great solution, it is working fine for me to show the rupees symbol in invoice PDF in magento.

Solution Steps :

1.Download the font that support Indian Rupee symbol. recommended dejavu-sans font.

http://dejavu-fonts.org/wiki/Download

https://sourceforge.net/projects/dejavu/files/dejavu/2.36/dejavu-sans-ttf-2.36.zip/download

2.Place the font in lib directory(projectname/lib).

3.open app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php and app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php

  1. copy paste both files under local

a) app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php

b) app/code/loacl/Mage/Sales/Model/Order/Pdf/Items/Abstract.php

and replace

$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Re-4.4.1.ttf');

with

$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/dejavu-sans/DejaVuSans.ttf');

(in _setFontRegular(), _setFontBold(), _setFontItalic() functions in both files.)

  1. Admin -> System --> Manage Currency -->Symbols --> Copy your symbol like in my case "₹" and save.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.