ele Posted February 24, 2009 Share Posted February 24, 2009 1、将压缩包内的文件,解压覆盖至原始文件。2、后台操作:Back Office >> Preferences >> PDF确保当前语言为中文,Font选择simhei,保存。在中文状态下,新建一个订单,完成订单后,即可下载一份中文订单。下载说明:为了安装方便,我把字体文件放到了压缩包内,如果需要马上使用,请下载prestashop.part1.rar ~ prestashop.part3.rar如果想使用自己的字体,或者想做一些修改,可下载prestashop-nofont.rar 并到http://acko.net/node/56 下载ufpdf----------------------------------------------------------------------------------------------------------以下信息需要程序知识,不熟悉的可略过。原理,prestashop的pdf制作工具使用的fpdf项目,但该项目不支持unicode编码,但是有一个ufpdf项目是在fpdf基础上做了修改,并且支持unicode编码的。但是其工作需要借助另一个开源项目(ttf2ufm),将ttf文件转换为ufm文件。所以,我们要做的就是将ufpdf整合至prestashop,然后使用ttf2ufm转换一个已知的ttf(true type font)文件,这一步在ufpdf的README中有详细介绍。以下为详细介绍:这里下载ufpdf http://acko.net/node/56解压、安装进入目录ufpdfcd ttf2ufm-srcmake install转化ttf文件,这里我们以simhei.ttf为例ttf2pt1 -a -F simhei.ttf进入ufpdf/tools下,可以看到makefontuni.phpphp -q makefontuni.php simhei.ttf simhei.ufm将生成出来的simhei.phpsimhei.zsimhei.ctg.z拷贝至prestashop的/tools/fpdf/font下复制一个b字体[或者再生成一个同样的粗体文件]cp -p simhei.php simheib.php将ufpdf.php中的代码注释掉//if(!class_exists('UFPDF'))//{//define('UFPDF_VERSION','0.1');//include_once 'fpdf.php';......最后//}拷贝该文件至prestashop的/tools/fpdf下修改/class/PDF.php-----include_once(_PS_FPDF_PATH_.'fpdf.php');-----改为:-----define('FPDF_FONTPATH',_PS_FPDF_PATH_.'font/');include_once(_PS_FPDF_PATH_.'fpdf.php');include_once(_PS_FPDF_PATH_.'ufpdf.php');-----登录prestashop后台,选择你的中文,Back Office >> Preferences >> PDF选择font为simheiok现在去前台选择中文之后打印订单吧!什么?还是乱码?哦,忘记说了,prestashop的订单也有语言,也就是说,你很有可能使用了一个其他语言的订单。不信可以连上数据库,select * from ps_orders;看看你的订单中的id_lang是不是中文id_lang。问题,eshop中的pdf功能在中国可能没有太多的实际作用,不过在其他应用中,可能会有帮助。 Link to comment Share on other sites More sharing options...
ele Posted February 24, 2009 Author Share Posted February 24, 2009 附件附件附件附件附件附件 prestashop-nofont.zip Link to comment Share on other sites More sharing options...
ele Posted February 24, 2009 Author Share Posted February 24, 2009 这个论坛rar的后缀名不认...以下这些文件,下载之后将最后的后缀名.zip去掉再解压.... prestashop.zip.001.zip Link to comment Share on other sites More sharing options...
ele Posted February 24, 2009 Author Share Posted February 24, 2009 字数字数字数 prestashop.zip.002.zip Link to comment Share on other sites More sharing options...
ele Posted February 24, 2009 Author Share Posted February 24, 2009 字数字数字数字数字数字数 prestashop.zip.003.zip Link to comment Share on other sites More sharing options...
ele Posted February 24, 2009 Author Share Posted February 24, 2009 字数字数字数字数字数字数abc prestashop.zip.004.zip Link to comment Share on other sites More sharing options...
billy song Posted March 2, 2009 Share Posted March 2, 2009 hi Philippe,I can unzip your upload file. When i unzip it, it always display the error(the archive is broken). Link to comment Share on other sites More sharing options...
billy song Posted March 2, 2009 Share Posted March 2, 2009 我解压缩不了上面的分阵压缩文件! Link to comment Share on other sites More sharing options...
ele Posted March 2, 2009 Author Share Posted March 2, 2009 我分卷压缩文件后得到的后缀名为.001--.004这个后缀名无法上传这个论坛。所以我手动又在后面加了个.zip。请下载之后,将最后的.zip去掉,最后得到的文件应该是:prestashop.zip.001prestashop.zip.002prestashop.zip.003prestashop.zip.004然后就可以解压了。抱歉.. Link to comment Share on other sites More sharing options...
billy song Posted March 3, 2009 Share Posted March 3, 2009 谢谢大侠!!!!! Link to comment Share on other sites More sharing options...
ele Posted March 3, 2009 Author Share Posted March 3, 2009 大家共同学习,分享经验,没有大虾大蟹。 Link to comment Share on other sites More sharing options...
billy song Posted March 4, 2009 Share Posted March 4, 2009 你好,我还想再请教个问题,为什么PDF导出与字符集无关呢,因为我在后台选择任何字符集都不影响,好象只与字体有关(黑体),只要设置了字体就可以的。我的数据库是UTF-8的,而且我看到程序中也有TOOLS::icov这样的方法来转换字符集的。能否解释下,谢谢! Link to comment Share on other sites More sharing options...
ele Posted March 4, 2009 Author Share Posted March 4, 2009 在PDF.php中字符串在被写到pdf之前会经历这个函数: Tools::iconv('utf-8', self::encoding(), $str); 而,self::encoding 的会做一些这样的事。 static private function encoding() { return (isset(self::$_pdfparams[self::$_iso]) AND is_array(self::$_pdfparams[self::$_iso]) AND self::$_pdfparams[self::$_iso]['encoding']) ? self::$_pdfparams[self::$_iso]['encoding'] : 'iso-8859-1'; } Tools.php 中的iconv方法 会做一些这样的事。 static public function iconv($from, $to, $string) { $converted = htmlentities($string, ENT_NOQUOTES, $from); $converted = html_entity_decode($converted, ENT_NOQUOTES, $to); return $converted; } 在具体运行中,一般的形式是:Tools::iconv('utf-8', 'iso-8859-1', $str);另一方面,我们来看常规的字符转换函数iconv。如果将一个utf-8的字符串转成iso-8859-1,这个函数会返回'' iconv('utf-8','iso-8859-1',$str); 我的猜想是,因为在Tools::iconv 中的html_entity_decode 把字符串转成iso-8859-1时返回了空,从而放弃了这个返回规则,而返回了utf-8格式的字符串。粗略研究,有错误还望指出。 Link to comment Share on other sites More sharing options...
billy song Posted March 4, 2009 Share Posted March 4, 2009 哦,他对iconv这个方法进行了重写,不在使用php原有的方法,而重写的方法对中文不进行转码的,是失效的,只对英文的起作用。原来如此,谢谢了!我原来一直没有完全弄清楚原理,所以一直是乱码,而且我原先也按照网上的方法汉化过,但是生成的字体文件总是错误的,导致一直未能解决,而且也未相通上面的问题,所以一直非常困惑,感谢! Link to comment Share on other sites More sharing options...
billy song Posted March 4, 2009 Share Posted March 4, 2009 能不能请教一个问题,就是关于网站前台的搜索功能方面的问题,搜索的原理是什么呢?是搜索产品的什么字段?description?万分感谢! Link to comment Share on other sites More sharing options...
ele Posted March 9, 2009 Author Share Posted March 9, 2009 搜索都是提交给:search.php提交字段叫:search_query这里是search类classes/Search.php它提供方法:find代码写的很清楚咯,看一看就知道了哈。 Link to comment Share on other sites More sharing options...
AndyLAU Posted March 19, 2009 Share Posted March 19, 2009 Thanks to Star,you are my hero~HAHA~ Link to comment Share on other sites More sharing options...
Star Posted March 20, 2009 Share Posted March 20, 2009 试了很多次,分卷解压都无法成功,谁帮个忙重新压缩一下传给我可以吗?我的邮箱 [email protected] ,谢谢! I just sent it to you... Check your qq mail box. Link to comment Share on other sites More sharing options...
^e-dian~ Posted April 1, 2009 Share Posted April 1, 2009 我也是试了很多次,分卷解压都无法成功,谁帮个忙重新压缩一下传给我可以吗?我的邮箱 [email protected],谢谢! Link to comment Share on other sites More sharing options...
Star Posted April 3, 2009 Share Posted April 3, 2009 我也是试了很多次,分卷解压都无法成功,谁帮个忙重新压缩一下传给我可以吗?我的邮箱 [email protected],谢谢! I just sent it to you. Check you live.com mail box. Link to comment Share on other sites More sharing options...
^e-dian~ Posted April 3, 2009 Share Posted April 3, 2009 谢谢star。。。不过我把simhei.phpsimhei.zsimhei.ctg.z放在/tools/fpdf/font下出现问题 FPDF error: Unsupported font type: TrueTypeUnicode是哪里出错了呢?? 请帮忙。。。多谢 Link to comment Share on other sites More sharing options...
Don Posted April 16, 2009 Share Posted April 16, 2009 能把后面4个分段压缩包发给我一下吗?[email protected] Link to comment Share on other sites More sharing options...
Pisces_HJ Posted July 10, 2009 Share Posted July 10, 2009 为什么我的中文显示是空白? Link to comment Share on other sites More sharing options...
profan Posted May 22, 2010 Share Posted May 22, 2010 那个文件能不能在PM我一下呢 谢谢 Link to comment Share on other sites More sharing options...
harries Posted September 21, 2010 Share Posted September 21, 2010 我也是试了很多次,分卷解压都无法成功,谁帮个忙重新压缩一下传给我可以吗?我的邮箱 [email protected]thank you very much Link to comment Share on other sites More sharing options...
harries Posted September 21, 2010 Share Posted September 21, 2010 up help me Link to comment Share on other sites More sharing options...
harries Posted September 21, 2010 Share Posted September 21, 2010 prestashop Version 1.3.1.1 出现问题 FPDF error: Unsupported font type: TrueTypeUnicode是哪里出错了呢?? 请帮忙。。。多谢 Link to comment Share on other sites More sharing options...
jasper-yy Posted March 16, 2011 Share Posted March 16, 2011 你好,我下载了,但解压不了,能发一份到我邮箱吗?谢谢![email protected] Link to comment Share on other sites More sharing options...
frites Posted July 6, 2011 Share Posted July 6, 2011 请大虾们帮帮忙,Prestashop 1.4.2.5,试了这个方法,显示错误FPDF error: Unsupported font type: TrueTypeUnicode,错在哪里呢?各位都成功了吗? Link to comment Share on other sites More sharing options...
beingtony Posted September 6, 2012 Share Posted September 6, 2012 我也解压不了 能否发个压缩文件给我 [email protected] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now