1

i'm unable to print czech characters. I'm using HTML2PDF v3.18
example:

html page contain: Žlica Čizvedèna
It's viewed right on browser (with doctype/head/body)

PDF output contains: (from html without doctype/head/body and iconv to cp1252 all text)
- - online: Žlica ?izvedèna
- - on localhost: Žlica Cizvedèna

Note, in the pdf i can't print right the "Č"...

Any ideas?

2

have you tried to use a specific font ?
Ancien pseudo : lolo

3

I've tried with Arial, Helvetica, Times, Courier...
But i'm unable to add other fonts. I've tried, for example, with:

$html2pdf = new HTML2PDF('P','A4','it', array (mL, MT, MR, MB));

require('html2pdf_v3.18/_fpdf/font/makefont/makefont.php');


$html2pdf->pdf->AddFont('helvetica'); // <- it work
$html2pdf->pdf->SetFont('helvetica'); // <- it work

// MakeFont('calligra.ttf','calligra.afm'); // <- i don't tried this, because i'm unable to find any .afm file anywhere...

however, the following don't work:

// $html2pdf->$pdf->AddFont('times','','times.php'); // <- get error "FPDF error: Could not include font definition file"
// $html2pdf->SetFont('times'); // <- get error "Fatal error: Call to undefined function: setfont()"

p.s.: i've tried with Times and Times it's seem on PDF... even the AddFont('times... get error... i think this is strange, or i'm ignore something?...


4

There's no Č character in CP 1252, so iconv to CP 1252 is the wrong solution.

Your question has been asked several times before on this forum, please read the instructions at:
http://www.fpdf.org/en/tutorial/tuto7.htm
for how to add support for an encoding which fully supports Czech.
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

5

I've tried ALL encoding (not only iconv to cp1252), but nothing...
On the tutorial it seems that i must use MakeFont to create a definition file, it's right?...
Anywhere, ...
$html2pdf->$pdf->AddFont('times','','times.php'); // <- get error "FPDF error: Could not include font definition file"
it don't work, even times.php esists on font folder, ...so i fear it don't work also with definition file created with makefont...

6

Ancien pseudo : lolo

7

It don't help me. I'm unable to add fonts...
For example, i tried to use helveticab... (it's included on font folder: "helveticab.php")

on the html:

<span style="font-family:helveticab; color:#000000;">
some text
</span>

1) without any change on php:
the result is "FPDF error: Undefined font: helveticab"

2) with change in the php:

method a:
$html2pdf->AddFont('helveticab');
$html2pdf->SetFont('helveticab');
the result is "FPDF error: Could not include font definition file"

method b:
$html2pdf->pdf->AddFont('helveticab');
$html2pdf->pdf->SetFont('helveticab');
the result is "FPDF error: Could not include font definition file"

method c:
using AddFont('helveticab','','helveticab.php'), referring to "->pdf" or not...
the result is "FPDF error: Could not include font definition file"

if i can't neither add font already provided, make a specific font is useless...

I'm desperate...

8

helveticab is helvetica in bold wink

=> $html2pdf->AddFont('Helvetica, 'B', 'helveticab.php');

but helvetica is already loaded by fpdf automaticaly... ig you want to test the addFont method, you must use it with a new specific font...


try to use this : http://www.fpdf.org/en/tutorial/tuto7.htm only with fpdf, and when it will be ok, apply the same thing with html2pdf
Ancien pseudo : lolo