rush Posted February 19, 2008 Share Posted February 19, 2008 Hello, guys, it's me again. I realized that I have to patch file classes/PDF.php to support other encodings than the default iso-8859-1. Czech language needs cp1250 (or iso-8859-2) as we use a lot of strange characters. :-D Sadly, FPDF doesn't support UTF-8, so I made brand new cp1250 fonts and modified classes/PDF.php to use them when needed. I also attached czech translation. You may review it at http://labs.logic.cz/patches/prestashop-0.9.7/invoices.patch. I hope it's now more generic solution. The fonts can be downloaded here http://labs.logic.cz/patches/prestashop-0.9.7/fonts-cp1250.tar.gz. Link to comment Share on other sites More sharing options...
digic Posted February 24, 2008 Share Posted February 24, 2008 Nice work MAN! Maybe you can help me with Russian language fonts: How you do the fonts files with your codepage? Thank you. Link to comment Share on other sites More sharing options...
rush Posted February 24, 2008 Author Share Posted February 24, 2008 Hey! :-) I followed this tutorial: http://www.fpdf.org/en/tutorial/tuto7.htm Here you can prepare your fonts: http://fpdf.fruit-lab.de/ Hope it helps :-) Let me know :-) Link to comment Share on other sites More sharing options...
Bruno Leveque Posted February 24, 2008 Share Posted February 24, 2008 Hi rush! Good job! We will have a look to that tutorial in order to improve PDF for all languages Best regards, Link to comment Share on other sites More sharing options...
digic Posted February 28, 2008 Share Posted February 28, 2008 Good day everybody! Rush can you tell me - how I can change the encoding of currency names in PDF.php file? Thank you! Link to comment Share on other sites More sharing options...
rush Posted February 28, 2008 Author Share Posted February 28, 2008 Hi, digic! I see! Wait a second, I will upload updated patch. Link to comment Share on other sites More sharing options...
rush Posted February 28, 2008 Author Share Posted February 28, 2008 Ok, just another Quick&Dirty hack Original patched file classes/PDF.php line 195 self::$currency = new Currency(intval(self::$order->id_currency)); Patched patched :-D file classes/PDF.php line 195 self::$currency = new Currency(intval(self::$order->id_currency)); self::$currency->sign = iconv('utf-8', self::encoding(), self::$currency->sign); You may download the whole damn thing at http://labs.logic.cz/patches/prestashop-0.9.7/invoices-v2.patch :-) Enjoy! Link to comment Share on other sites More sharing options...
digic Posted February 28, 2008 Share Posted February 28, 2008 Rush - you are the MAN! Big thnks!!! Link to comment Share on other sites More sharing options...
Zhivko Posted March 3, 2008 Share Posted March 3, 2008 Hi, I made some modifications to /classes/PDF.php and /admin/tabs/AdminTranslations.php to enable PDF translations in BackOffice Here are the modifications: 1. PDF.php: - Removed private variable $_translations - Replaced protected function l($string) with a new one 2. AdminTranslations.php: - Added pdf translations file to language export - Modified public function postProcess() to save pdf translations in /translations/{language}/pdf.php - Modified public function display() to display a link to PDF translations page - Added function displayFormPDF() which displays all PDF labels to translate All modifications are marked with //ZKOEV. There are some outstanding issues which I'm going to work on soon: 1. Remove private static $_pdfparams from PDF.php and store PDF encoding/font settings in config file 2. Manage PDF encoding/font settings in Tools->Preferences page. 3. Copy pdf translations when copying a language Please test the pdf module and share any ideas you have. * Note that PDF.php $_pdfparams is set for BG language, encoding and font. Change it with you local language. PDF.php AdminTranslations.php Link to comment Share on other sites More sharing options...
Bruno Leveque Posted March 4, 2008 Share Posted March 4, 2008 Hi Zhivko, Good job!! We'll have a look to your code today and integrate it for next release Really thank you Best regards, Link to comment Share on other sites More sharing options...
Zhivko Posted March 4, 2008 Share Posted March 4, 2008 Hi, To manage PDF encoding/font settings I added a new tab 'PDF Invoice' (look at the screenshot) and added a pdf icon called 44.gif (44 is the id of the new tab) to /img/t folder. Here are the new modifications to the files: 1. New file /admin/tabs/AdminPDF.php - allows encoding and font management in BackOffice -> Preferences -> PDF Invoice tab. Encoding is set to configuration table as PS_PDF_ENCODING_{language} for the current language . Font is set to configuration table as PS_PDF_FONT_{language} for the current language . 2. Modified /classes/PDF.php - read configuration from database 3. Modified /admin/tabs/AdminTranslations.php - copy pdf translations when copying a language. All modifications are markeed with //ZKOEV v2 Regards, Zhivko PDF.php AdminPDF.php AdminTranslations.php Link to comment Share on other sites More sharing options...
concerto Posted March 13, 2008 Share Posted March 13, 2008 Hi Zhivko, I was following your instructions, copied your files to right locations, added the pdf tab, translated pdf, but I keep getting the following error: "FPDF error: Could not include font definition file" What am I doing wrong? BTW, I am trying to translate pdf in Croatian/Bosnian/Serbian (latin script) Encoding is ISO-8859-2. It is all pretty greek to me, so if you could speek human I would appreciate. Link to comment Share on other sites More sharing options...
Zhivko Posted March 13, 2008 Share Posted March 13, 2008 Hi, Look at the third post in this topic. Rush says: I followed this tutorial: http://www.fpdf.org/en/tutorial/tuto7.htm Here you can prepare your fonts: http://fpdf.fruit-lab.de/ You have to prepare a definition file for your prefered font and encoding and place it in /tools/fpdf/fonts folder. PS: You need definition files for regular and bold font type. PDF invoice uses both. For ex. times and timesb. Link to comment Share on other sites More sharing options...
concerto Posted March 13, 2008 Share Posted March 13, 2008 Thanks Zhivko, I will give it a try and let you all know about the outcome... if any Link to comment Share on other sites More sharing options...
west28 Posted March 22, 2008 Share Posted March 22, 2008 ok. In catalog fonts I have files: 879598_arial.php 4,1 k 2008-03-22 11:06 ---- 879598_arial.t1a 1,1 M 2008-03-22 11:07 ---- 879598_arial.z 193,2 k 2008-03-22 11:06 ---- 879598_arial.afm 104,9 k 2008-03-22 11:06 ---- 879598_arialb.php 4,1 k 2008-03-22 11:09 ---- 879598_arialb.t1a 1,1 M 2008-03-22 11:09 ---- 879598_arialb.z 193,2 k 2008-03-22 11:09 ---- 879598_arialb.afm 104,9 k 2008-03-22 11:09 ---- [..] In admin tab I choose 879598_arial and ISO-8859-2. Now I got error 500 What's wrong ?? Link to comment Share on other sites More sharing options...
Rimantas Posted July 17, 2008 Share Posted July 17, 2008 how download http://www.prestashop.com/forums/viewthread/885/#4727i got blank page? Link to comment Share on other sites More sharing options...
shaile_martin Posted November 28, 2009 Share Posted November 28, 2009 hi !! How to deal when order is more than 150 product the atomatically generate new delivery slip with next 151th product to next 150th product and so on . 1 Link to comment Share on other sites More sharing options...
mouse1 Posted November 6, 2011 Share Posted November 6, 2011 ok. In catalog fonts I have files: 879598_arial.php 4,1 k 2008-03-22 11:06 ---- 879598_arial.t1a 1,1 M 2008-03-22 11:07 ---- 879598_arial.z 193,2 k 2008-03-22 11:06 ---- 879598_arial.afm 104,9 k 2008-03-22 11:06 ---- 879598_arialb.php 4,1 k 2008-03-22 11:09 ---- 879598_arialb.t1a 1,1 M 2008-03-22 11:09 ---- 879598_arialb.z 193,2 k 2008-03-22 11:09 ---- 879598_arialb.afm 104,9 k 2008-03-22 11:09 ---- [..] In admin tab I choose 879598_arial and ISO-8859-2. Now I got error 500 What's wrong ?? I'm having the same problem :-( Did you find the solution eventually? Thank you. UPDATE: Problem solved! This happened to me after update from 1.4.0.17 to 1.4.4.1. In my new shop, I used a PDF.php file from my previous version. This PDF.php from my old version contained a custom-made command for "payment due" which was defined in Tools.php. The problem was that I forgot to copy the string from my old Tool.php to the new one, so the PDF could not receive the data and so gave me this error. :-)) 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