【发布时间】:2012-09-03 09:13:55
【问题描述】:
我正在覆盖 pdf 发票模型以在 pdf 的页脚中添加一些文本。当我从后端打印发票时,会显示奇怪的字符。
app/code/local/Company/Invoice/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Company_Invoice>
<version>0.1.0</version>
</Company_Invoice>
</modules>
<global>
<models>
<sales>
<rewrite>
<order_pdf_invoice>Company_Invoice_Model_Order_Pdf_Invoice</order_pdf_invoice>
</rewrite>
</sales>
</models>
</global>
</config>
app/code/local/Company/Invoice/Model/Order/Pdf/Invoice.php http://pastebin.com/VQaWr0Xg
如果禁用此模块,默认 Magento 会正确打印发票。有什么想法吗?
【问题讨论】:
-
试过添加编码吗?
$page->drawText(Mage::helper('sales')->__('test'),25,25, 'UTF-8); -
好像不行
-
尝试使用
&$page通过引用传递页面,我的 pdf 创建工作就像这样
标签: php magento pdf-generation