Magento打印(配送单、退款单、发票)时PDF中的乱码问题
来源:互联网 发布:淘宝面膜机危害 编辑:程序博客网 时间:2024/04/29 00:28
我使用Magento1.4.2,在其自带的TTF文件不能很好地解析中文字符,TTF文件的位置在网站根目录下的/lib/LinLibertineFont/中。打印的中文字符都是这样的
解决方法:
1.在Windows下复制一个MSYHBD.TTF(微软雅黑)至网站根目录下的/lib/LinLibertineFont/中
2.修改app\code\core\Mage\Sales\Model\Order\Pdf\Abstract.php
protected function _setFontRegular($object, $size = 7) { //$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertineC_Re-2.8.0.ttf');注释掉这行 $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/MSYHBD.TTF'); $object->setFont($font, $size); return $font; } protected function _setFontBold($object, $size = 7) { // $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Bd-2.8.1.ttf');注释掉这行 $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/MSYHBD.TTF'); $object->setFont($font, $size); return $font; } protected function _setFontItalic($object, $size = 7) { //$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_It-2.8.2.ttf');注释掉这行 $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/MSYHBD.TTF'); $object->setFont($font, $size); return $font; }注:这里主要是讲解解决方法,实际修改请将上述方法写成插件的形式,不要破坏Magento的产品代码。
- Magento打印(配送单、退款单、发票)时PDF中的乱码问题
- magento 开发-- 单页结账时根据选择的配送方式来控制支付方式的显示
- 单配送物流算法(简化为旅行商问题)
- oper tools教程 配送出库单
- pdf中的四色字 改为单黑
- pdf中的四色字 改为单黑
- Magento PDF发票,支持中文,以及修改的办法.
- 拒绝乱码:做外贸系统,打印俄文快递单时,避免俄文乱码的方法
- Magento 单产品对应多URL的问题
- struts2中表单提交乱码问题
- myeclipse中表单提交乱码问题
- 京东配送机器人在人大完成全球首单
- magento -- 结账时默认选中其中一种配送方式
- 支付宝查询退款接口(统一收单交易退款查询)
- Magento订单打印(pdf格式) 转:鹏程万里
- 入库单打印
- 打印发货单
- ABAP 出库单打印
- python 的内嵌time模板翻译及说明
- 冠军尤文资料
- 多态产生的条件
- HDFS上读写
- 打印任意位数的水仙花数
- Magento打印(配送单、退款单、发票)时PDF中的乱码问题
- MySQL索引类型一览 让MySQL高效运行起来
- 一个优秀的程序员必需具备
- MySQL全文检索中Like索引的实现
- MySQL索引背后的数据结构及算法原理
- 一致性哈希算法及其在分布式系统中的应用
- HTML制作之模板使用
- linux帧缓冲(framebuffer)驱动
- C++ GDI+ 安装 配置 使用