Special chars issue in TCPDF output

QuestionsSpecial chars issue in TCPDF output
Steve Borruso asked 1 year ago

Hello Abu,

Hope all is well with you.

All of my grids use customized TCPDF routines that (after a lot or research) I’ve been able to write.

My problem is in getting TCPDF to output special chars (up arrow, down arrow, delta symbol, etc.)

Yes … I’ve spent 2 full days tearing my hair out trying to get 3 specific chars to show up in a PDF doc ūüėČ

I’ve looked at hundreds of TCPDF docs and forum appends and coded as many examples which all still display a “?” instead of these chars.

I know this is maybe more of a tcpdf issue than phpgrid but was hoping you might have some insight …

I’ve downloaded several ttf files (symbols, Wingdings, dejavu_sans, etc.) … latest one being symbol.tff – downloaded it, verified these chars are in there., and converted it to these respective files –
my_symbol.php
my_symbol.afm
my_sysmol.z
and placed them in the /phpgrid/lib/inc/tcpdf/fonts directory (there was a symbol.php file already there but no .afm or .z files)

Latest code attempt that always result in a ? instead of the special char –

$this->AddFont(‘my_symbol’,”,’my_symbol’);

// $this->SetFont(‘helvetica’,”,’9′,’wingding3′);

$this->SetFont(‘my_symbol’,”,’9′);

$d = ‘↑’;¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬†// up arrow – displays a question mark in the pdf doc

// $d = ‘↑’;¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† // up arrow – no difference
// $d = utf8_decode($d); // no difference
// $d = ‘&’;¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬†// this works
// $d = ‘€’;¬† ¬† ¬† ¬† ¬† ¬† // this works
// $d ='<span style=”font-family: arial;”>’.$d.'</span>’; // no difference

$this->writeHTMLCell($w, $rowcount * 5, ”, ”, $d, ‘LRTB’, 0, 1, false, ‘L’, false);

// always results in a ? being displayed instead of the special char … no errors reported anywhere

I’m kinda new to dealing with fonts and such … this probably has to do with my font files not being placed correctly, or specifying their usage incorrectly,¬† but with no errors produced anywhere I’m finally at a loss.

Any assistance is most appreciated.

Thanks !!

Steve

 

2 Answers
Steve Borruso answered 1 year ago

Just realized that in my opening append that a couple of my variable assignment values above show up as being converted¬† ¬†the $d =¬†& #8593¬† ¬† and¬†¬†$d = ‘& #8364;’;¬† ¬†showed up as converted symbols

Abu Ghufran Staff answered 1 year ago

Thanks for updating.

Closing this ticket.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

13 + 0 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?