Senjaman Posted July 8, 2011 Share Posted July 8, 2011 I didn't change anything in tools.php and it works.Your problem might be with PDF.php.Did you modified the line concerning encoding as I said in a post yesterday ? if you did it, just verify you didn't forget the comma at the end of the lane.And for japanese it works with kozminproregular font.Just look at the files I attached with this post maybe it can help. myfiles.zip 1 Link to comment Share on other sites More sharing options...
majinkun180 Posted July 8, 2011 Share Posted July 8, 2011 Thank you for your fast response. I did insert that line you posted yesterday but still no go. It's still a blank screen. I guess I'll just compare your files with mine and see if there is any difference or anything I missed. Thanks! Link to comment Share on other sites More sharing options...
majinkun180 Posted July 8, 2011 Share Posted July 8, 2011 Hi Senjaman, I kinda got frustrated and just tried and inserted your files into my folders and I actually got an error message this time around TCPDF ERROR: Could not include font definition file: simheiwas the outcome. At least its not an blank screen? I guess I have to keep trying. Link to comment Share on other sites More sharing options...
majinkun180 Posted July 8, 2011 Share Posted July 8, 2011 Sorry for so many posts, but it's working now! Thank you all for your hardwork and effort! Thanks Senjaman for the files I changed the simhei to kozminproregular font then it worked! Link to comment Share on other sites More sharing options...
Senjaman Posted July 9, 2011 Share Posted July 9, 2011 You're right, simhei font is not included in TCPDF, I added it myself.For japanese the right font is kozminproregular. 1 Link to comment Share on other sites More sharing options...
SkyHiRider Posted September 13, 2011 Share Posted September 13, 2011 I don't know the reason for you to migrate to TCPDF, but I have found a WORKING solution how to fix the fonts for the default PDF engine that comes with Prestashop - Czech/Slovak symbols work properly on pdf invoices and the thread is located here: http://www.prestasho...-classespdfphp/ The solution follows: Download the zip file or generate your own fonts via the guide in that thread. Copy ALL of the language files to /prestashop/tools/fpdf/font Change permissions of all new files (add execute rights to all of them) -- chmod u+x,g+x,o+x * Change the font to one of the new ones and enjoy! Link to comment Share on other sites More sharing options...
lucass Posted September 13, 2011 Share Posted September 13, 2011 Reason? It's fancy, that's why we are all after it Link to comment Share on other sites More sharing options...
SkyHiRider Posted September 14, 2011 Share Posted September 14, 2011 Reason? It's fancy, that's why we are all after it Oh well, never mind me then, I'm not enough fancy for you to be hanging oround with the cool kids But frankly, I don't understand why this functionality isn't present in the base install of Prestashop and has to be fixed by googling the forums. Link to comment Share on other sites More sharing options...
Mstyle Posted September 20, 2011 Share Posted September 20, 2011 I made it using Lucass files and now it is showing my language symbols. But i have one problem, so i need HELP. All data that is written under Description is stretched, however it should be on the Left side... So where i should go to fix this problem? All other data is showing right.. Here is the image of what is look like and how it should be. Any ideas? ========================== Thanx to ezakimak for post #43. I solved it. Link to comment Share on other sites More sharing options...
billygirl Posted October 5, 2011 Share Posted October 5, 2011 Hello Can anybody help? I get this error Warning: scandir(C:\wamp\www\prestashop/tools/tcpdf/fonts/utils/enc,C:\wamp\www\prestashop/tools/tcpdf/fonts/utils/enc) [function.scandir]: The system cannot find the path specified. (code: 3) in C:\wamp\www\prestashop\powerhouse\tabs\AdminPDF.php on line 54 When I try to change the pdf settings. I dont think I have the utils folder in the tcpdf folder. Please assist Link to comment Share on other sites More sharing options...
ClickStars Posted October 29, 2011 Share Posted October 29, 2011 hi guys, it works on ver1.4.4.1 thanks for your help and file from Senjaman Link to comment Share on other sites More sharing options...
cserpentis Posted December 8, 2011 Share Posted December 8, 2011 how to change € sign to EUR, at the moment there's just ? I just found how to fix the € sign in the PDF. The problem is that function displayPrice in classes/Tools.php when called with true argument is trying to convert in to non-unicode char and this ends up messing up the char code. So either replace the first argument in displayPrice($somevariable, $somevariable, true) with false, or just edit the function displayPrice in classes/Tools.php, and delete this piece of code: if ($no_utf8) return str_replace('€', chr(128), $ret); Link to comment Share on other sites More sharing options...
lucass Posted December 8, 2011 Share Posted December 8, 2011 or back office / Payment / Currencies / Edit Euro / and rewrite symbol to "EUR" personally, I prefer using EUR instead of € sign Link to comment Share on other sites More sharing options...
hichamino Posted December 16, 2011 Share Posted December 16, 2011 j'ai pu faire marcher TCPDF avec 1.4.3 mais j'ai encore un problème avec l'affichage du nombre de page dans la facture j'ai quelque chose qui ressemble a ça "P.1 /{nb1}", le reste fonctionne parfaitement, si quelque a une idée d’où ça peu venir? merci. Link to comment Share on other sites More sharing options...
ezakimak Posted December 21, 2011 Share Posted December 21, 2011 In PDF.php , in method Footer() Replace this line of code $this->Cell(190, 5, ' '."\n".Tools::iconv('utf-8', self::encoding(), 'P. ').$this->GroupPageNo().' / '.$this->PageGroupAlias(), 'T', 1, 'R'); With this one $this->Cell(190, 5, ' '."\n".Tools::iconv('utf-8', self::encoding(), 'P. ').$this->getAliasNumPage().' / '.$this->getAliasNbPages(), 'T', 1, 'R'); This solved that problem in my installation (ps1.4.0.17), perhaps it could help you too Regards Hugo Takada j'ai pu faire marcher TCPDF avec 1.4.3 mais j'ai encore un problème avec l'affichage du nombre de page dans la facture j'ai quelque chose qui ressemble a ça "P.1 /{nb1}", le reste fonctionne parfaitement, si quelque a une idée d’où ça peu venir? merci. Link to comment Share on other sites More sharing options...
hichamino Posted December 21, 2011 Share Posted December 21, 2011 merci ca marche parfaitement; thank you, for your help; Link to comment Share on other sites More sharing options...
renamed_account_117550 Posted January 14, 2012 Share Posted January 14, 2012 Hello everyone, I'm using Prestashop version 1.4.4.1, can you help to instruct me step by step to make Traditional Chinese work well for Invoice PDF? Seems that Prestashop has changed a lot compared to the modifications in the early posts. Additionally, I'm using latest TCPDF (Jan 12, 2012). Appreciate your help and happy new year! Link to comment Share on other sites More sharing options...
hichamino Posted January 20, 2012 Share Posted January 20, 2012 Hello everyone, I'm using Prestashop version 1.4.4.1, can you help to instruct me step by step to make Traditional Chinese work well for Invoice PDF? Seems that Prestashop has changed a lot compared to the modifications in the early posts. Additionally, I'm using latest TCPDF (Jan 12, 2012). Appreciate your help and happy new year! desolé pour le retard: regarde et suit les etapes une par une: http://www.prestashop.com/forums/topic/142673-migrer-de-fpdf-vers-tcpdf/page__hl__tcpdf__fromsearch__1 Link to comment Share on other sites More sharing options...
renamed_account_117550 Posted January 22, 2012 Share Posted January 22, 2012 Thanks a lot for your information, Hichamino! After made a bunch of changes (please refer to my attachments including the original and updated files base don Prestashop 1.4.4.1final) per many people's suggesiton in this thread, I got a error like this when clicking PDF, "TCPDF ERROR: Could not include font definition file: arial". I do notice that Senjaman's post on 07 July 2011 , saying that "this was due to the name of arial font in the archive of tcpdf I downloaded, it was named arialunicid0.php, I renamed it arial.php and it works.". But in my case where the latest TCPDF version (Jan 12, 2012) is being used, meaning there is no arial related php files under fonts folder. So how could we solve this issue? Can anybody help? Thanks! Prestashop_forum_post_Jan21.zip Link to comment Share on other sites More sharing options...
EQ10000 Posted January 25, 2012 Share Posted January 25, 2012 I set the fonts to "kozminproregular" for Chinese. However, some words (tax=稅, description=說明) can't show in pdf. Is there another fonts I can use? Or, is there a way we could add another font? Many thanks. Link to comment Share on other sites More sharing options...
John_John Posted April 21, 2012 Share Posted April 21, 2012 Great topic as i am in dire need to fix this as well! Have downloaded TCPDF and followed most of the instructions on this topic, but i cant help but see problems still I am trying to have 3 languages printable in PDF: English, Chinese Simplified, Chinese Traditional I am using Prestashop 1.4.7 Would anyone have this setup working already and willing to provide the edited files in 1 zip file? Thank you very very much! Link to comment Share on other sites More sharing options...
saldy74 Posted April 21, 2012 Share Posted April 21, 2012 I tried every steps for 1.4.7.0 and I got blank page when I finish the ordering process. When I click on PDF file, I got Server Error as below. Does anyone meet the same issue? Please help! HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. Link to comment Share on other sites More sharing options...
John_John Posted April 22, 2012 Share Posted April 22, 2012 Any help on this would be much appreciated ! Big thanks in advance Link to comment Share on other sites More sharing options...
ezakimak Posted April 23, 2012 Share Posted April 23, 2012 Hi, Could you give more details on your issues, I have 1.4.7.3 working(following the advises in this thread) with Japanese. Regards Any help on this would be much appreciated ! Big thanks in advance Link to comment Share on other sites More sharing options...
John_John Posted April 23, 2012 Share Posted April 23, 2012 Thanks ezakimak for your reply I am using 1.4.7.0 and would like to be able to have Simplified Chinese (and Traditional Chinese) in the invoices as some clients input Chinese in their details. Have tried the options that people provided, for example: - download TCPDF and change necessary files, change font to "stsongstdlight" I would still get the following problems: - No currency sign like "£, €, ¥" - Weird spacing of the table (the description of products) So am asking how to make it work for 1.4.7 and if Chinese Simplified and Traditional is possible Thanks in advance Link to comment Share on other sites More sharing options...
ezakimak Posted April 23, 2012 Share Posted April 23, 2012 Try these files , please backup yours at first. I use kozminproregular font (backoffice->orders->pdf) Hope it helps Regards Hugo p. these are for ps1.4.7.3 Thanks ezakimak for your reply I am using 1.4.7.0 and would.... tcpdf.zip Link to comment Share on other sites More sharing options...
ezakimak Posted April 23, 2012 Share Posted April 23, 2012 Regarding this, in previous post, I mentioned that class TCPDF in method MultiCell has 'J' as default align argument , you must modify it to 'L'. ... - Weird spacing of the table (the description of products) Link to comment Share on other sites More sharing options...
John_John Posted April 23, 2012 Share Posted April 23, 2012 Thanks for the files ezakimak! Have checked it and the files are different then version 1.4.7 I went ahead and made the changes again as mentioned in previous posts and it seems to be working ok... but with some strange problems still - page number underneath appears as P. 1 / {nb1} how to fix this? Link to comment Share on other sites More sharing options...
ezakimak Posted April 23, 2012 Share Posted April 23, 2012 This is a bug in PDF class, find this piece of code in this class/method PDF::Footer() and replace, I think I have addressed this in previous post too. Regards Hugo /*pe modification , resolves page number issue * before it printed like this 1/nb1, 1/nb2 */ //original line commented //$this->Cell(190, 5, ' '."\n".Tools::iconv('utf-8', self::encoding(), 'P. ').$this->GroupPageNo().' / '.$this->PageGroupAlias(), 'T', 1, 'R'); //new line $this->Cell(190, 5, ' '."\n".Tools::iconv('utf-8', self::encoding(), 'P. ').$this->getAliasNumPage().' / '.$this->getAliasNbPages(), 'T', 1, 'R'); /* pe extention */ Thanks for the files ezakimak! Have checked it and the files are different then version 1.4.7 I went ahead and made the changes again as mentioned in previous posts and it seems to be working ok... but with some strange problems still - page number underneath appears as P. 1 / {nb1} how to fix this? Link to comment Share on other sites More sharing options...
John_John Posted April 23, 2012 Share Posted April 23, 2012 Awesome! Everything works now and it seems to do Chinese Simplified and Traditional as well Did change all the currencies to normal text form, like EUR, USD, RMB etc because the normal currency signs didnt work. The rest seem to be working well! Thanks again ezakimak! p.s. nice shop! Link to comment Share on other sites More sharing options...
ezakimak Posted April 23, 2012 Share Posted April 23, 2012 John, As far as I recall this I solved changing this method in class Tools, look at the commented out line of code. Regards Hugo ps. I'm glad you liked the shop public static function iconv($from, $to, $string) { if (function_exists('iconv')) //return iconv($from, $to.'//TRANSLIT', str_replace('ツ・', '¥', str_replace('ツ」', '£', str_replace('竄ャ', '€', $string)))); return $string; return html_entity_decode(htmlentities($string, ENT_NOQUOTES, $from), ENT_NOQUOTES, $to); } Awesome! Everything works now and it seems to do Chinese Simplified and Traditional as well Did change all the currencies to normal text form, like EUR, USD, RMB etc because the normal currency signs didnt work. The rest seem to be working well! Thanks again ezakimak! p.s. nice shop! Link to comment Share on other sites More sharing options...
maorfi1 Posted April 25, 2012 Share Posted April 25, 2012 Please tell me how to connect to the tcpdf version 1.4.7? There is a default cost FPDF, which works really is not correctly. Thank you! Link to comment Share on other sites More sharing options...
cooro Posted June 5, 2012 Share Posted June 5, 2012 Hi, Could you give more details on your issues, I have 1.4.7.3 working(following the advises in this thread) with Japanese. Regards Can you help me, I got the same problem, blank page Link to comment Share on other sites More sharing options...
ezakimak Posted July 4, 2012 Share Posted July 4, 2012 Did you get it to work ? Can you help me, I got the same problem, blank page Link to comment Share on other sites More sharing options...
cooro Posted July 4, 2012 Share Posted July 4, 2012 (edited) Did you get it to work ? the key is add the font, i can't get it , when i add you files , and add the font in the PDF.php under the _initPDFFonts() function $this->AddFont('simhei', '', 'font/simhei.php'); and 'encoding' => (isset($conf['PS_PDF_ENCODING_'.$isoCode]) AND $conf['PS_PDF_ENCODING_'.$isoCode] == true) ? $conf['PS_PDF_ENCODING_'.$isoCode] : 'UTF-8', remplace 'encoding' =>'utf-8', after go to backoffice->orders->pdf, it's empty, no font, so when i click view invoice, th page is white, can't appear the pdf how to do that? Edited July 4, 2012 by cooro (see edit history) Link to comment Share on other sites More sharing options...
ezakimak Posted July 5, 2012 Share Posted July 5, 2012 Hi, First of all, can you tell me which prestashop version you are using and the steps you followed to try to accomplish this. the key is add the font, i can't get it , when i add you files , and add the font in the PDF.php under the _initPDFFonts() function $this->AddFont('simhei', '', 'font/simhei.php'); and 'encoding' => (isset($conf['PS_PDF_ENCODING_'.$isoCode]) AND $conf['PS_PDF_ENCODING_'.$isoCode] == true) ? $conf['PS_PDF_ENCODING_'.$isoCode] : 'UTF-8', remplace 'encoding' =>'utf-8', after go to backoffice->orders->pdf, it's empty, no font, so when i click view invoice, th page is white, can't appear the pdf how to do that? Link to comment Share on other sites More sharing options...
mareksmareks Posted October 15, 2012 Share Posted October 15, 2012 Hi, I have problem with pdf in 1.4.9 version. I have tried all these solutions but none work. Have anyone tried to force 1.4.9 version work with TCPDF? Link to comment Share on other sites More sharing options...
ezakimak Posted October 16, 2012 Share Posted October 16, 2012 I have it working on ps1.4.9.0 following steps provided here , please follow again carefully you must have missed something Hi, I have problem with pdf in 1.4.9 version. I have tried all these solutions but none work. Have anyone tried to force 1.4.9 version work with TCPDF? Link to comment Share on other sites More sharing options...
mareksmareks Posted October 16, 2012 Share Posted October 16, 2012 Hi ezakimak! Those are great news. Biggest challlange is lining in all files i need to change. because line numbers are changed again. Ie it possible that you post again all changes i have to make? Or maybe you can post whole file and i could try to replace my files? Link to comment Share on other sites More sharing options...
ezakimak Posted October 16, 2012 Share Posted October 16, 2012 (edited) Refer to post #126 I can't send my files because I have many other customization that would break your installation. Hi ezakimak! Those are great news. Biggest challlange is lining in all files i need to change. because line numbers are changed again. Ie it possible that you post again all changes i have to make? Or maybe you can post whole file and i could try to replace my files? Edited October 16, 2012 by ezakimak (see edit history) Link to comment Share on other sites More sharing options...
mareksmareks Posted October 16, 2012 Share Posted October 16, 2012 (edited) Hi. I used these files (post 126) you provided and now i get error when i want to generate pdf (in backoffice and frontoffice). error = http://mysite/admin0...?id_order=2 not found Its little strange that in /override/classes folder i didnt have to overwrite any file Edited October 16, 2012 by mareksmareks (see edit history) Link to comment Share on other sites More sharing options...
ezakimak Posted October 16, 2012 Share Posted October 16, 2012 what do you mean by "I didnt have to override..." ?? Hi. I used these files (post 126) you provided and now i get error when i want to generate pdf (in backoffice and frontoffice). error = http://mysite/admin0...?id_order=2 not found Its little strange that in /override/classes folder i didnt have to overwrite any file Link to comment Share on other sites More sharing options...
mareksmareks Posted October 16, 2012 Share Posted October 16, 2012 Its little strange that in /override/classes folder i didnt have to overwrite any file. See attachment. PDF.php Product.php Tools.php these are your provided files. And there was no files named by this before i copied them there. So i had to replace /admin/tabs/adminpdf and /config/defines.inc.php but files in /override/classes i didnt ave to overwrite because there was no files called pdf,product and tools. Link to comment Share on other sites More sharing options...
ezakimak Posted October 16, 2012 Share Posted October 16, 2012 You should enable error display in your site to see what errors you have edit config.inc.php in /yourprestashopinstall/config/ Its little strange that in /override/classes folder i didnt have to overwrite any file. See attachment. PDF.php Product.php Tools.php these are your provided files. And there was no files named by this before i copied them there. So i had to replace /admin/tabs/adminpdf and /config/defines.inc.php but files in /override/classes i didnt ave to overwrite because there was no files called pdf,product and tools. Link to comment Share on other sites More sharing options...
mareksmareks Posted October 16, 2012 Share Posted October 16, 2012 ok, I dont that and i found out that there waas my mistake. I left define('_PS_TCPDF_PATH_', _PS_TOOL_DIR_.'tcpdf/'); in /config/config.inc.php.So now everything works! Thanks ezakimak! I have the same problem with that []P. 1 / 1 problem but i see you already have solution for that! 1 Link to comment Share on other sites More sharing options...
mjax Posted October 18, 2012 Share Posted October 18, 2012 convertSign() function breaks the utf-8 currecy symbol classes/PDF.php static protected function convertSign($s) { return str_replace(array('€', '£', '¥'), array(chr(128), chr(163), chr(165)), $s); } Link to comment Share on other sites More sharing options...
ezakimak Posted October 19, 2012 Share Posted October 19, 2012 (edited) Yes you are right, that's why I overrode that method, look at override/pdf.php convertSign() function breaks the utf-8 currecy symbol classes/PDF.php static protected function convertSign($s) { return str_replace(array('€', '£', '¥'), array(chr(128), chr(163), chr(165)), $s); } Edited October 19, 2012 by ezakimak (see edit history) Link to comment Share on other sites More sharing options...
taonylu Posted October 30, 2012 Share Posted October 30, 2012 (edited) For chinese user,please take a look of my attachment. The prestashop version I used is 1.4.9.0. 对简体中文用户,请下载并参考我上传的附件。里面包含了相应的修改过的文件。如想自己修改,请使用文件对比工具查看。 另,附有更新日期为2012-10-24的tcpdf_5_9_195。有文件已修改。 tcpdf_5_9_195.zip 2012-10-24 百度网盘下载地址 :http://pan.baidu.com/share/link?shareid=90170&uk=3338978994 Edited October 30, 2012 by taonylu (see edit history) Link to comment Share on other sites More sharing options...
John_John Posted February 21, 2013 Share Posted February 21, 2013 Will this still work for v1.5.3? Link to comment Share on other sites More sharing options...
taonylu Posted February 21, 2013 Share Posted February 21, 2013 Yes,it is. Link to comment Share on other sites More sharing options...
John_John Posted February 21, 2013 Share Posted February 21, 2013 It appears that v1.5.3 already uses tcpdf and uses UTF-8 But there is still a problem with display of Chinese text. So have played around and couldn't get "kozminproregular" to work as well. Dug around and found out that the font was not available in the folder tools/tcpdf/fonts So added the kozminproregular.php and finally could render the Chinese text Although not 'perfect' as it can't seem to render this Chinese character "馠" but the rest does render correctly for now. Who knows which font is best used for Chinese character rendering as "kozminproregular" is best for Japanese instead Link to comment Share on other sites More sharing options...
degger Posted February 28, 2013 Share Posted February 28, 2013 (edited) please help having error : Strict Standards: Declaration of PDF_PageGroupCore::_beginpage() should be compatible with that of TCPDF::_beginpage() inC:\xampp\htdocs\israel\classes\PDF.php on line 31 Strict Standards: Declaration of PDF_PageGroupCore::StartPageGroup() should be compatible with that of TCPDF::startPageGroup() inC:\xampp\htdocs\israel\classes\PDF.php on line 31 TCPDF ERROR: Some data has already been output, can't send PDF file ps 1.4.8.2 thanks Edited March 2, 2013 by degger (see edit history) Link to comment Share on other sites More sharing options...
Nika Koiava Posted April 25, 2013 Share Posted April 25, 2013 Hi all! I'm using Prestashop 1.5.3. and I have the same problem in tcpdf. I have uploaded tcpdf folder in "Tools" directory, then replaced files: config/define.inc.php override/claasse/PDF.php Product.php Tools.php This files I have donwloaded from this forum. But unfortunately I have an fatall error: "Class name must be a valid object or a string in Classes/controller/controller.php". If someone have any idea, how can fix this problem, please help. Thanks in advance. Link to comment Share on other sites More sharing options...
ezakimak Posted April 25, 2013 Share Posted April 25, 2013 Hi, PS 1.5 does not need these tricks. Hi all! I'm using Prestashop 1.5.3. and I have the same problem in tcpdf. I have uploaded tcpdf folder in "Tools" directory, then replaced files: config/define.inc.php override/claasse/PDF.php Product.php Tools.php This files I have donwloaded from this forum. But unfortunately I have an fatall error: "Class name must be a valid object or a string in Classes/controller/controller.php". If someone have any idea, how can fix this problem, please help. Thanks in advance. Link to comment Share on other sites More sharing options...
Tora Posted July 23, 2013 Share Posted July 23, 2013 (edited) Hi! Here is my full solution for prestashop 1.4.11.0. I use 3 languages RU, DE, EN and 1 currency EUR. In admin tab PDF you can choice UTF-8 and font - not all fonts work properly. I use "freesans". "-" - comment this line "+" - add this line Upload TCPDF to folder "Tools" FPDF --> TCPDF /classes/PDF.php -27 include_once(_PS_FPDF_PATH_.'fpdf.php'); -29 class PDF_PageGroupCore extends FPDF +31 include_once(_PS_TCPDF_PATH_.'tcpdf.php'); +32 class PDF_PageGroupCore extends TCPDF -114 FPDF::FPDF($orientation, $unit, $format); +115 parent::__construct($orientation, $unit, $format); -304 $this->Cell(190, 5, Tools::iconv('utf-8', self::encoding(), self::l('P. ')).$this->GroupPageNo().' / '.$this->PageGroupAlias(), 'T', 1, 'R'); +305 $this->Cell(190, 5, Tools::iconv('utf-8', self::encoding(), self::l('P. ')).$this->getAliasNumPage().' / '.$this->getAliasNbPages(), 'T', 1, 'R'); -477 $this->MultiCell($w[0], 5, self::convertSign(Tools::iconv('utf-8', self::encoding(), $product['product_name'])), 'B'); +478 $this->MultiCell($w[0], 5, self::convertSign(Tools::iconv('utf-8', self::encoding(), $product['product_name'])), 'B', 'L'); -575 $pdf->AliasNbPages(); +576 $pdf->getAliasNbPages(); -1048 $this->MultiCell($w[++$i], count($w), self::convertSign(Tools::iconv('utf-8', self::encoding(), $product['product_name'])), 'B'); +1049 $this->MultiCell($w[++$i], count($w)-1, self::convertSign(Tools::iconv('utf-8', self::encoding(), $product['product_name'])), 'B', 'L'); -1343 return str_replace(array('€', '£', '¥', '¢', '£', '¥', '€'), array(chr(128), chr(163), chr(165), chr(162), chr(163), chr(165), chr(128)), $s); +1344 return $s; /classes/Tools.php -440 if ($no_utf8) -441 return str_replace(array('€', '£', '¥'), array(chr(128), chr(163), chr(165)), $ret); +442 return $ret; /admin/tabs/AdminPDF.php -40 $fontFiles = scandir(_PS_FPDF_PATH_.'font'); +41 $fontFiles = scandir(_PS_TCPDF_PATH_.'fonts'); +57 $arr['mode'] = 'UTF-8'; +58 $arr['name'] = 'UTF-8'; +59 array_push($encodingList, $arr); /config/defines.inc.php +96 define('_PS_TCPDF_PATH_', _PS_TOOL_DIR_.'tcpdf/'); Dead Sea cosmetic Edited July 25, 2013 by Tora (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted July 24, 2013 Share Posted July 24, 2013 Nice work. Link to comment Share on other sites More sharing options...
betisimo76 Posted November 22, 2013 Share Posted November 22, 2013 (edited) Hi!! I work with 1.4.8.2 and Tora's modifications work perfectly with this version (Thanks!!). I only have found one issue: I have 3 languages in my store: spanish, english and russian.Information about customer appears correctly in all languages, including ciryllic russian (name, address, phone, ...) but names of fields are not translated. I translate them in Settings->Traductions->PDF (reference, description, slip #,...) but nothing changes. Always are in the default language of the store (spanish). Can anybody help me with this? Thanks a lot Edited November 22, 2013 by betisimo76 (see edit history) Link to comment Share on other sites More sharing options...
Tora Posted November 22, 2013 Share Posted November 22, 2013 Hi!! I work with 1.4.8.2 and Tora's modifications work perfectly with this version (Thanks!!). I only have found one issue: I have 3 languages in my store: spanish, english and russian.Information about customer appears correctly in all languages, including ciryllic russian (name, address, phone, ...) but names of fields are not translated. I translate them in Settings->Traductions->PDF (reference, description, slip #,...) but nothing changes. Always are in the default language of the store (spanish). Can anybody help me with this? Thanks a lot If you try to download invoice from back office - invoice will appear in your back office language, except customer details and ordered items. Change your back office language and try again. Link to comment Share on other sites More sharing options...
betisimo76 Posted November 23, 2013 Share Posted November 23, 2013 (edited) Fantastic Tora! You've helped me another time! I have one last issue but I'm not sure if I must to write here. After Tora's modifications, I have installed pdfinvoiceplus from http://www.prestashop.com/forums/topic/154981-free-module-pdf-invoice-plus/ to add some text in my invoices. Now, every text I write appear in red color. I have tried with many html tags,included special tags of this module, but nothing change. This is an example: <h1 style="color:#000;">Test TCPDF Methods in HTML</h1> <h2 style="color:blue;">IMPORTANT:</h2> <span style="color:blue;">If you are using user-generated content, the tcpdf tag can be unsafe. You can disable this tag by setting to false the <b>K_TCPDF_CALLS_IN_HTML</b> constant on TCPDF configuration file.</span> <h2>write1DBarcode method in HTML</h2> <p style="color:#000;">Test TCPDF Methods in HTML</p> <div style="color:#000;">Test TCPDF Methods in HTML</div> Anybody can help me? Thanks a lot. Edited November 23, 2013 by betisimo76 (see edit history) Link to comment Share on other sites More sharing options...
betisimo76 Posted November 23, 2013 Share Posted November 23, 2013 (edited) Solved!, Problem was accents with spanish language, I have to delete all of them. I think this is not the best solution, but, at least, it works. Now problem is ciryllic russian with TCPDF and module pssinvoiceplus. It is not recognized. Edited November 23, 2013 by betisimo76 (see edit history) Link to comment Share on other sites More sharing options...
betisimo76 Posted February 5, 2014 Share Posted February 5, 2014 Hello, All has been working perfectly with Tora changes, but now, we have updated our server to php5.4 and last version TCPDF (2014-2-3), and we can't print invoices: Strict Standards: Declaration of PDF_PageGroupCore::_beginpage() should be compatible with TCPDF::_beginpage($orientation = '', $format = '') in /home//classes/PDF.php on line 33Strict Standards: Declaration of PDF_PageGroupCore::StartPageGroup() should be compatible with TCPDF::startPageGroup($page = '') in /home/classes/PDF.php on line 33Warning: Cannot modify header information - headers already sent by (output started at /home//classes/PDF.php:33) in /home/tools/tcpdf/tcpdf.php on line 7631TCPDF ERROR: Some data has already been output to browser, can't send PDF file Somebody can help me? We have v1.4.8.2 PHP5.4 TCPDF (last version 2014-2-3) Link to comment Share on other sites More sharing options...
daybydayx Posted July 11, 2014 Share Posted July 11, 2014 Prestashop 1.4.11 can not work fine with TCPDF. Hello I use Prestashop 1.4.11.And I try to fix the bug for many times but I failed.Can somebody please upload php files for me to download? And this is what I see http://www.c-jade.com.tw/shoptest/pdf-invoice.php?id_order=56 == Error messageWarning: iconv() expects parameter 3 to be string, array given in [/size]/home/cjadecom/public_html/shoptest/classes/Tools.php on line 1210TCPDF ERROR: Some data has already been output, can't send PDF file== ==This is the Tools.php file line 1210 public static function iconv($from, $to, $string) { if (_PS_ICONV_) return iconv($from, $to.'//TRANSLIT', str_replace('¥', '¥', str_replace('£', '£', str_replace('€', '€', $string)))); return html_entity_decode(htmlentities($string, ENT_NOQUOTES, $from), ENT_NOQUOTES, $to); } == Please help me Attach files = my php files dayday_php.zip Link to comment Share on other sites More sharing options...
daybydayx Posted July 11, 2014 Share Posted July 11, 2014 For chinese user,please take a look of my attachment. The prestashop version I used is 1.4.9.0. 对简体中文用户,请下载并参考我上传的附件。里面包含了相应的修改过的文件。如想自己修改,请使用文件对比工具查看。 另,附有更新日期为2012-10-24的tcpdf_5_9_195。有文件已修改。 tcpdf_5_9_195.zip 2012-10-24 百度网盘下载地址 :http://pan.baidu.com/share/link?shareid=90170&uk=3338978994 您好連結不在了,您還有檔案嗎? Link to comment Share on other sites More sharing options...
tuk66 Posted July 11, 2014 Share Posted July 11, 2014 == Error message Warning: iconv() expects parameter 3 to be string, array given in [/size]/home/cjadecom/public_html/shoptest/classes/Tools.php on line 1210 TCPDF ERROR: Some data has already been output, can't send PDF file == == The problem is not in iconv() function but in code where this function is called. In general, you are trying to mix several incompatible libraries. This is an extremely debilitating. I would suggest to upgrade to a later version of PrestaShop where some PDF problems are already solved. 1 Link to comment Share on other sites More sharing options...
daybydayx Posted July 15, 2014 Share Posted July 15, 2014 The problem is not in iconv() function but in code where this function is called. In general, you are trying to mix several incompatible libraries. This is an extremely debilitating. I would suggest to upgrade to a later version of PrestaShop where some PDF problems are already solved. Thank you Link to comment Share on other sites More sharing options...
Recommended Posts