Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
FPDF i HR slova

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
hrv0j3



Joined: 03 Aug 2007
Posts: 34

PostPosted: 01.05.2009 18:29    Post subject: FPDF i HR slova Add user to your forum ignore list Reply with quote

Pozdrav svima opet Smile

Molio bih Vas pomoch.. naime.. pokusavam kreirat PDF pomocu fpdf i sve super.. samo me malo muce kao i uvijek.. nasa slova ć č ž đ š .. naime nemogu nigdje pronaci nacin kako da dobijem nasa slova pa bih Vas molio pomoch po tom pitanju Smile ...

Naravno ukoliko ima i neki bolji lib,class takodjer je dobrodoslo Very Happy

hvala!
Back to top
View user's profile Send private message MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 01.05.2009 19:34    Post subject: Add user to your forum ignore list Reply with quote

Davno je bilo, ali sjecam se da sam na Coolinarici buildao pdf-ove sa fpdf-om svojevremeno. HR slova su radila kako spada u iso-8859-2 encodingu.

Naravno, treba ti font file ispravan, sa characterima na pravom mjestu.
Ako imas .ttf font, imas online konverter ovdje: http://fpdf.fruit-lab.de/

Online generator u biti radi ono sto je opisano ovdje: http://www.fpdf.org/en/tutorial/tuto7.htm

Uploadas .ttf, odaberes iso-8859-2 map i dobijes nekoliko fileova za download, koje onda
includeas uz ostale fpdf fileove.

Nakon toga samo definiras path do font fileova, i koristis addFont() metodu:
Code:

define('FPDF_FONTPATH','/path/to/font_folder');
...
// npr:
$pdf->AddFont('961821_trebuc','','961821_trebuc.php');
...


Buduci da je cijeli site bio utf-8, tekstove za pdf sam prije poziva Cell(), WriteHTMLCell() i
slicnih metoda (po potrebi) protjerao kroz iconv(), nesto tipa:

Code:

    function draw_paragraph($width = 0, $txt, $fill = 0) {
        $this->lasth = 3.5;
        $this->SetFontSize(6.5);
        $this->SetTextColor(0);
        // $this->MultiCell($width, 5, $this->_convert($txt), 0, 'L', $fill);
        // $this->WriteHTML($txt, true, $fill);
        // function writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0)
        $this->WriteHTMLCell($width, 3.5, '', '', $txt, 0, 1, $fill);
        // $this->Write(5, $txt);
    }

    function _convert($str) {
        return iconv('UTF-8', 'iso-8859-2//TRANSLIT', $str);
    }


HTH

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
hrv0j3



Joined: 03 Aug 2007
Posts: 34

PostPosted: 02.05.2009 09:21    Post subject: Add user to your forum ignore list Reply with quote

tako sam i rijesio to Smile hvala!
Back to top
View user's profile Send private message MSN Messenger
cindreta



Joined: 10 Dec 2004
Posts: 30

PostPosted: 13.05.2009 20:23    Post subject: Add user to your forum ignore list Reply with quote

pozdrav imam sličan problem, pokušao sam na više načina, radim sa domPDF-om, dakle probao sam i uploadati font na sajt spomenut gore i dobijem ga i sve ali nikako. Zatim sam probao sa ConverCharset klasom ali opet ništa previše.

ako netko može pomoći ili neki savjet dati jer ono više mi ide na živce sve to Smile

ovo je najblliže što sam uspio dobiti koristeći win-1250 encoding za font i koristeći "php iconv" sa isim encodingom:


hvala
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group