ezakimak Posted June 18, 2012 Share Posted June 18, 2012 Hi, Anybody could point me where to set the PDF encondings ? Thanks Hugo 1 Link to comment Share on other sites More sharing options...
gfilipek Posted June 24, 2012 Share Posted June 24, 2012 Hi. I have the same question. Where can i change PDF font ? Default generate "?" instead "ł" for example. Link to comment Share on other sites More sharing options...
deadegghead Posted July 29, 2012 Share Posted July 29, 2012 Hi, I had the same problem. It seems you can't set encoding or font in 1.5.0.13 (according to my findings in BO). But it also seems to be temporary, according to this bug tracker comment: http://forge.prestashop.com/browse/PSCFV-1887?focusedCommentId=52279&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-52279 In that comment you'll find a working solution for changing font. I tested with freeserif, for czech characters (well, just "č" in fact, i still don't have the invoice transalted). I'd just recommend instead of editing /prestashop/classes/pdf/PDFGenerator.php, edit /prestashop/override/classes/pdf/PDFGenerator.php - It works just the same, but you don't get lost in editing core files. By default, the file looks like this: <?php class PDFGenerator extends PDFGeneratorCore { } You want to change it to this (with the font that works for you): <?php class PDFGenerator extends PDFGeneratorCore { public function setFontForLang($iso_lang) { $this->setFont('freeserif'); } } The system checks for language used, before setting which font to use for generating the pdf. It's just there's nowhere to define which fonts go with which languages, but that shouldn't take long. (I'd say it's important and easy enough to be fixed in final version. When the pdf generator is already (finally, for us non-basic-latin) changed .) 1 Link to comment Share on other sites More sharing options...
Dmit Posted August 11, 2012 Share Posted August 11, 2012 Hi, I had the same problem. It seems you can't set encoding or font in 1.5.0.13 (according to my findings in BO). But it also seems to be temporary, according to this bug tracker comment: http://forge.prestas...l#comment-52279 In that comment you'll find a working solution for changing font. I tested with freeserif, for czech characters (well, just "č" in fact, i still don't have the invoice transalted). I'd just recommend instead of editing /prestashop/classes/pdf/PDFGenerator.php, edit /prestashop/override/classes/pdf/PDFGenerator.php - It works just the same, but you don't get lost in editing core files. By default, the file looks like this: <?php class PDFGenerator extends PDFGeneratorCore { } You want to change it to this (with the font that works for you): <?php class PDFGenerator extends PDFGeneratorCore { public function setFontForLang($iso_lang) { $this->setFont('freeserif'); } } The system checks for language used, before setting which font to use for generating the pdf. It's just there's nowhere to define which fonts go with which languages, but that shouldn't take long. (I'd say it's important and easy enough to be fixed in final version. When the pdf generator is already (finally, for us non-basic-latin) changed .) Thank you. Russian works pdf Link to comment Share on other sites More sharing options...
Nick Fedchik Posted August 13, 2012 Share Posted August 13, 2012 (edited) PrestaShop 1.5.0.15 classes\pdf\PdfGenerator.php line 37 cnange const DEFAULT_FONT = 'helvetica'; to const DEFAULT_FONT = 'freeserif'; UPDATE: Works fine both on my workstation with Win7 and on CentOS 6.3 server Edited August 16, 2012 by Nick Fedchik (see edit history) 5 Link to comment Share on other sites More sharing options...
Nick Fedchik Posted August 15, 2012 Share Posted August 15, 2012 To Core developers: Is it possible to add a dropdown list of fonts supported by TCPDF in BO? Let's merchants decide which font is compatible and looks much correct. http://www.tcpdf.org/fonts.php At least, the PDF Core (standard) fonts are: courier : Courier courierB : Courier Bold courierBI : Courier Bold Italic courierI : Courier Italic helvetica : Helvetica helveticaB : Helvetica Bold helveticaBI : Helvetica Bold Italic helveticaI : Helvetica Italic symbol : Symbol times : Times New Roman timesB : Times New Roman Bold timesBI : Times New Roman Bold Italic timesI : Times New Roman Italic zapfdingbats : Zapf Dingbats I see it's possible to upload a TTF to server and convert it for TCPDF. Another feature - Google Fonts Link to comment Share on other sites More sharing options...
Nick Fedchik Posted August 22, 2012 Share Posted August 22, 2012 (edited) I see a lot of changes in the svn regarding to PDF A tools/tcpdf/encodings_maps.php A tools/tcpdf/datamatrix.php A tools/tcpdf/tcpdf.php A tools/tcpdf/tcpdf.crt A tools/tcpdf/fonts A tools/tcpdf/fonts/cid0jp.php A tools/tcpdf/fonts/freeserif.php A tools/tcpdf/fonts/freeserif.z A tools/tcpdf/fonts/helveticai.php A tools/tcpdf/fonts/helveticabi.php A tools/tcpdf/fonts/dejavusans.ctg.z A tools/tcpdf/fonts/dejavusans.php A tools/tcpdf/fonts/helvetica.php A tools/tcpdf/fonts/dejavusans.z A tools/tcpdf/fonts/helveticab.php A tools/tcpdf/fonts/freeserif.ctg.z A tools/tcpdf/sRGB.icc A tools/tcpdf/pdf417.php A tools/tcpdf/spotcolors.php A tools/tcpdf/tcpdf.fdf A tools/tcpdf/LICENSE.TXT A tools/tcpdf/tcpdf.p12 A tools/tcpdf/tcpdf_parser.php A tools/tcpdf/cache A tools/tcpdf/cache/table_data_demo.txt A tools/tcpdf/cache/utf8test.txt A tools/tcpdf/cache/chapter_demo_1.txt A tools/tcpdf/cache/chapter_demo_2.txt A tools/tcpdf/qrcode.php A tools/tcpdf/unicode_data.php A tools/tcpdf/config A tools/tcpdf/config/lang A tools/tcpdf/config/lang/urd.php A tools/tcpdf/config/lang/mlt.php A tools/tcpdf/config/lang/heb.php A tools/tcpdf/config/lang/hrv.php A tools/tcpdf/config/lang/zho.php A tools/tcpdf/config/lang/bel.php A tools/tcpdf/config/lang/dan.php A tools/tcpdf/config/lang/slv.php A tools/tcpdf/config/lang/srp.php A tools/tcpdf/config/lang/cat.php A tools/tcpdf/config/lang/far.php A tools/tcpdf/config/lang/ces.php A tools/tcpdf/config/lang/mkd.php A tools/tcpdf/config/lang/hat.php A tools/tcpdf/config/lang/ger.php A tools/tcpdf/config/lang/nob.php A tools/tcpdf/config/lang/kat.php A tools/tcpdf/config/lang/msa.php A tools/tcpdf/config/lang/bul.php A tools/tcpdf/config/lang/yid.php A tools/tcpdf/config/lang/hye.php A tools/tcpdf/config/lang/cym.php A tools/tcpdf/config/lang/swa.php A tools/tcpdf/config/lang/pol.php A tools/tcpdf/config/lang/hun.php A tools/tcpdf/config/lang/est.php A tools/tcpdf/config/lang/kor.php A tools/tcpdf/config/lang/sqi.php A tools/tcpdf/config/lang/eus.php A tools/tcpdf/config/lang/swe.php A tools/tcpdf/config/lang/ron.php A tools/tcpdf/config/lang/por.php A tools/tcpdf/config/lang/ukr.php A tools/tcpdf/config/lang/ara.php A tools/tcpdf/config/lang/chi.php A tools/tcpdf/config/lang/bra.php A tools/tcpdf/config/lang/gle.php A tools/tcpdf/config/lang/afr.php A tools/tcpdf/config/lang/fra.php A tools/tcpdf/config/lang/glg.php A tools/tcpdf/config/lang/eng.php A tools/tcpdf/config/lang/rus.php A tools/tcpdf/config/lang/ind.php A tools/tcpdf/config/lang/ita.php A tools/tcpdf/config/lang/nld.php A tools/tcpdf/config/lang/aze.php A tools/tcpdf/config/lang/spa.php A tools/tcpdf/config/lang/jpn.php A tools/tcpdf/config/tcpdf_config.php A tools/tcpdf/config/tcpdf_config_alt.php A tools/tcpdf/barcodes.php A tools/tcpdf/htmlcolors.php A tools/tcpdf/tcpdf_filters.php Hope it solve the llocal fonts/encodings problem in PDF, will test it! Default font still doesn't changed: class PDFGeneratorCore extends TCPDF { const DEFAULT_FONT = 'helvetica'; Edited August 22, 2012 by Nick Fedchik (see edit history) Link to comment Share on other sites More sharing options...
dydyt Posted August 25, 2012 Share Posted August 25, 2012 PrestaShop 1.5.0.15 classes\pdf\PdfGenerator.php line 37 cnange const DEFAULT_FONT = 'helvetica'; to const DEFAULT_FONT = 'freeserif'; UPDATE: Works fine both on my workstation with Win7 and on CentOS 6.3 server OMG! You're genius! WORKS! THANK YOU! Link to comment Share on other sites More sharing options...
blacktop Posted September 18, 2012 Share Posted September 18, 2012 Thank you very very much! It works fo Russian pretty fine! Link to comment Share on other sites More sharing options...
mehnihma Posted October 28, 2012 Share Posted October 28, 2012 This does not work in PS 1.5.2 please help??? Link to comment Share on other sites More sharing options...
Hasini Posted December 3, 2012 Share Posted December 3, 2012 It didn't work for me either, on 1.5.2. I'm trying to make the font support Hebrew. Do you guys know where to change the enconding? Link to comment Share on other sites More sharing options...
WooF Posted January 1, 2013 Share Posted January 1, 2013 PrestaShop 1.5.0.15 classes\pdf\PdfGenerator.php line 37 cnange const DEFAULT_FONT = 'helvetica'; to const DEFAULT_FONT = 'freeserif'; UPDATE: Works fine both on my workstation with Win7 and on CentOS 6.3 server Works fine for me in PrestaShop™ 1.5.2.0 and ubuntu server. Thank you. Link to comment Share on other sites More sharing options...
the.rampage.rado Posted January 1, 2013 Share Posted January 1, 2013 Changing fonts for this issue simply can't stop working on following version. Did it on 1.5.3.1 also and it works great. freeserif si not much in conjunction with the shop's fonts but it's OK. I've disabled invoices so better work and look like that rather not work at all. Link to comment Share on other sites More sharing options...
lordshop Posted February 22, 2013 Share Posted February 22, 2013 thanks. Works also in Greek in ver 1.5.3.1 Link to comment Share on other sites More sharing options...
Diakro Posted February 23, 2013 Share Posted February 23, 2013 (edited) PrestaShop 1.5.0.15 classes\pdf\PdfGenerator.php line 37 cnange const DEFAULT_FONT = 'helvetica'; to const DEFAULT_FONT = 'freeserif'; UPDATE: Works fine both on my workstation with Win7 and on CentOS 6.3 server Thanks! In case of the hungarian special characters: const DEFAULT_FONT = 'dejavusans'; Edited February 23, 2013 by wram (see edit history) Link to comment Share on other sites More sharing options...
jimsake2 Posted March 19, 2013 Share Posted March 19, 2013 Works fine with freeserif in 1.5.3.1 for greek thanks guys Link to comment Share on other sites More sharing options...
tsimento Posted November 3, 2013 Share Posted November 3, 2013 hi , on version 1.5.2.0 any other solution for ???? on PDF invoice ( Greek) For some reasson which didnt know "freeserif" doesnt change the Bug or helvetica stay Default font . Link to comment Share on other sites More sharing options...
dandumit Posted January 23, 2014 Share Posted January 23, 2014 in PDFGenerator.php it's an array public $font_by_lang = array( 'ja' => 'cid0jp', 'ro' => 'freeserif' I have added 'ro'. you may add a 'gr' entry with a font that it's supported by TCPDF Link to comment Share on other sites More sharing options...
dosnavigator Posted October 22, 2015 Share Posted October 22, 2015 in PDFGenerator.php it's an array public $font_by_lang = array( 'ja' => 'cid0jp', 'ro' => 'freeserif' I have added 'ro'. you may add a 'gr' entry with a font that it's supported by TCPDF Thank you dandumit . It worked. Link to comment Share on other sites More sharing options...
Recommended Posts