nobody78 Posted July 16, 2008 Share Posted July 16, 2008 Hi all!Mistakes at generating PDF with cyrillic (attach 2.jpg). I think "bug" in a font. Has gone on a way http://www.prestashop.com/forums/viewthread/3161/ and convert a font, but there is new mistake FPDF error: Undefined font: crr35__w B Any ideas?(1.0 RC5)PS. Can't attach original 1251 font and converted .php Link to comment Share on other sites More sharing options...
Matthieu Biart Posted July 16, 2008 Share Posted July 16, 2008 Hi nobody78! (very weird to say that, usualy I say "Hi everybody" lol)You should ask to "Zhivko" who worked very much on this feature.We made the PDF "utf-8 hack" together, and I think he will enjoy to help you and will be definitly faster on this domain than me (because of not having his hand on the whole PrestaShop code but only on the encoding section). Link to comment Share on other sites More sharing options...
nobody78 Posted July 16, 2008 Author Share Posted July 16, 2008 Thanks! Link to comment Share on other sites More sharing options...
Matthieu Biart Posted July 16, 2008 Share Posted July 16, 2008 You're welcome.Just think about reporting here the solution, or any extra details which could be helpfull for other users. Link to comment Share on other sites More sharing options...
nobody78 Posted July 16, 2008 Author Share Posted July 16, 2008 As Zhivko soon answer me ))) Link to comment Share on other sites More sharing options...
nobody78 Posted July 16, 2008 Author Share Posted July 16, 2008 I have edited classes/PDF.php function PDF($orientation='P', $unit='mm', $format='A4') { global $cookie; if (!isset($cookie) OR !is_object($cookie)) $cookie->id_lang = intval(Configuration::get('PS_LANG_DEFAULT')); $lang=strtoupper($lang); self::$_pdfparams[$lang] = array('encoding' => $conf['PS_PDF_ENCODING'], 'font' => $conf['PS_PDF_FONT']); FPDF::FPDF($orientation, $unit, $format); $font = self::embedfont(); if($font) { $this->AddFont($font); $this->AddFont($font, 'B'); } } resultPDF was created, but cyrillic font disappear...and PDF always with Helvetica font ((( Link to comment Share on other sites More sharing options...
nobody78 Posted July 18, 2008 Author Share Posted July 18, 2008 [sOLVED]1) Firts of all we have clean install RC5 (if NOT, this not work for previous generated invoices)2) Second, we should have TTF font supported necessary simbols for your language3) Third. Go to http://fpdf.fruit-lab.de/ choose map and convert font files to need format4) (if all OK) Download .php and .z files and rename *.php.txt to *.php5) Do NOT change files name6) Place this files to ./tools/fpdf/font folder7) Replace function PDF in ./classes/PDF.php with code below function PDF($orientation='P', $unit='mm', $format='A4') { global $cookie; if (!isset($cookie) OR !is_object($cookie)) $cookie->id_lang = intval(Configuration::get('PS_LANG_DEFAULT')); $lang = strtoupper(Language::getIsoById($cookie->id_lang)); $conf = Configuration::getMultiple(array('PS_PDF_ENCODING_'.$lang, 'PS_PDF_FONT_'.$lang)); $conf['PS_PDF_ENCODING'] = (isset($conf['PS_PDF_ENCODING_'.$lang]) AND $conf['PS_PDF_ENCODING_'.$lang] == true) ? $conf['PS_PDF_ENCODING_'.$lang] : 'iso-8859-1'; $conf['PS_PDF_FONT'] = (isset($conf['PS_PDF_FONT_'.$lang]) AND $conf['PS_PDF_FONT_'.$lang] == true) ? $conf['PS_PDF_FONT_'.$lang] : 'Arial'; self::$_pdfparams[$lang] = array('encoding' => $conf['PS_PDF_ENCODING'], 'font' => $conf['PS_PDF_FONT']); FPDF::FPDF($orientation, $unit, $format); $font = self::embedfont(); if($font) { $this->AddFont($font); $this->AddFont($font, 'B'); } } Save and close8) Go to administration panel - Preferences >> PDF, choose Encoding and created Font9) All done. Enjoy!Thanks for superhero495, mazvv, Bad_Boy, me and Presta-team )) Link to comment Share on other sites More sharing options...
middlevn Posted August 27, 2008 Share Posted August 27, 2008 Also take a look at this.http://www.prestashop.com/forums/viewthread/4223/general_discussion/pdf_invoice_displays_incorrectly/Hope this help.Middlevn Link to comment Share on other sites More sharing options...
Vassilis Posted September 11, 2008 Share Posted September 11, 2008 installation version 1.0.0.8created fonts uploaded .z file and .php(the one renamed from .txt) to /tools/fpdf/font/on backoffice i choose the encoding and the newfont (6681708a4f_arial) and save changes.When i go to an order and click on pdf icon.I get:FPDF error: Could not include font definition fileOfcourse i get an incorrect pdf invoice while using any other font or encoding.p.s my pdf.php translation file is tested either in normal utf-8 or even in my own encoding.Thanks in advance Link to comment Share on other sites More sharing options...
mudisoft Posted February 5, 2009 Share Posted February 5, 2009 installation version 1.0.0.8created fonts uploaded .z file and .php(the one renamed from .txt) to /tools/fpdf/font/on backoffice i choose the encoding and the newfont (6681708a4f_arial) and save changes.When i go to an order and click on pdf icon.I get:FPDF error: Could not include font definition fileOfcourse i get an incorrect pdf invoice while using any other font or encoding.p.s my pdf.php translation file is tested either in normal utf-8 or even in my own encoding.Thanks in advance I get the same thingcan someone give any further info? Link to comment Share on other sites More sharing options...
pildo Posted June 25, 2010 Share Posted June 25, 2010 can somebody help with this problem in 1.3.1? i need to get symbols like ľ,š,č,ť,Š,Č,Á,É... i think it is ISO-8859-2... Link to comment Share on other sites More sharing options...
istox Posted September 16, 2010 Share Posted September 16, 2010 Please help somebody with this problem in 1.3.1 Link to comment Share on other sites More sharing options...
alekmk Posted September 20, 2010 Share Posted September 20, 2010 Hi everybody,i appreciate your work, but this is not working for me... every time, i get this error: FPDF error: Could not include font definition filei want to add Arial font, with cp1251 encoding, for Macedonian Cyrillic letters (or am i doing it wrong? should I add a Mac C Times font or similar?) i uploaded arial.ttf on this web, and downloaded four files :*.php;*.z;*.t1a.ps;*.afm;I tried to follow FPDF Tutorial7 , but i cant understand the last step Declaration of the font in the script... where do i add that code line? $pdf->AddFont('Arial','','arial.php'); in which script??any help please,Alek Link to comment Share on other sites More sharing options...
Altan Posted October 26, 2010 Share Posted October 26, 2010 same message ... "FPDF error: Could not include font definition file" Link to comment Share on other sites More sharing options...
zinaf Posted February 9, 2012 Share Posted February 9, 2012 7) Replace function PDF in ./classes/PDF.php with code below Version 1.4.6.2 does not have this function in the pdf.php file. Therefore I could not finish with the instructions. Perhaps as a result of this I also get this error menioned already in this thread when I select the font that I have uploaded. and still no cyrillic for me. Success with this anyone? 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