1

Spipu Salut!

Nice work!

J'ai une question: je voudrais utiliser certaines caractère hongrois (ő, ű [337, 369]) dans le PDF, mais le résultat de sa conversion à õ et û (õ [245], û [251]).

Le pdf de police ont intégré l'encodage ANSI, peut-être que le problème. En Hongrie, nous utilisons iso-8859-2 encoding.

Avez-vous une idée de ce que j'ai à modifier ou définir?

Désolé pour mon français, je l'ai écrit en anglais, et Google traduit pour moi smile

Merci.

Lumpy de la Hongrie

2

Hi Lumpy !

you can speak in english if you want wink

wich version of PHP and html2pdf do you use ?

have you tried with the html entities ? (like in this page : http://www.w3schools.com/tags/ref_entities.asp)
Ancien pseudo : lolo

3

Hi!

Thanks for english, it's easier for me smile

I've tried the 3.12 html2pdf, and php4 and php5 also.

Yes, I've tried entities, and in the pdf I've seen the codes ( #337; #x0151; ), not the ő character (this name is O Double Acute, which is part of the iso-8859-2 or utf8 char-table). http://tlt.its.psu.edu/suggestions/international/bylanguage/hungarian.html#htmlcodes

I think it's an encoding problem may be, because in the generated pdf properties, at the embedded font section show the embedded font is Helvetica, Type1, ANSI encoding. If I can change the font-embedding coding then probably it will be fixed.

Any idea? May I try the new 3.13 version?

Many thanks,

Lumpy

4

On the line 1216 of html2pdf.class.php, try to change this :

$txt = html_entity_decode($txt, ENT_QUOTES, 'ISO-8859-15');

and tell me if it's working
Ancien pseudo : lolo

5

I've changed, but the php runs with this errors:

Warning: html_entity_decode(): charset `ISO-8859-2' not supported, assuming iso-8859-1 in .../.../html2pdf.class.php on line 1199

and the bottom of the page:

Warning: Cannot modify header information - headers already sent by (output started at .../.../html2pdf.class.php:1199) in .../.../_fpdf/fpdf.php on line 1019
FPDF error: Some data has already been output, can't send PDF file

I know, hungarian is a crazy language, with special chars smile

6

it seems that the pb comes from fpdf and not from html2pdf...

i have write a message on the fpdf's forum here : http://www.fpdf.org/phorum/read.php?f=1&i=42193&t=42193
Ancien pseudo : lolo

7

The solution is here : http://www.fpdf.org/en/tutorial/tuto7.htm

you have juste to create a specific font, and to use it...
Ancien pseudo : lolo

8

Thanks, I'm trying it, and telling if it works.

9

Salut,
Moi j'avais un probleme similaire avec les lettres allemands telque (ä, ö,ß...) et j'ai ecrit une fonction qui les remplace voila l'exemple:
function samrty_postfilter_cleanHTML($tpl, &$mysmarty)
{
$suchmuster[0] = '/\s\s+/';
$ersetzung[0] = ' ';
$suchmuster[2] = '/ö/';
$ersetzung[2] = 'ö';
$suchmuster[3] = '/ä/';
$ersetzung[3] = 'ä';
$suchmuster[7] = '/ß/';
$ersetzung[7] = 'ß';
........

return preg_replace($suchmuster, $ersetzung, $tpl);
}
je ne sais si sa vous aide mais voila ma solution qui fait ce que je veu en tou cas

10

Hi Spipu,

At least it's working!

So thanks for your help, and the html2pdf. This is fantastic!

I have generated the new font and I have to write the encoding in some file to iso-8859-2, and the AddFont in the 00_fpdf_codebar.class.php, then it works.

Thanks again,

Lumpy
Spipu (./7) :
The solution is here : http://www.fpdf.org/en/tutorial/tuto7.htm

you have juste to create a specific font, and to use it...

11

I have got a problem, a create font with polish letter (tahomapl.php and tahomapl.z, arialpl.php and arialpl.z) and i don't know how to use it.
If I use font-family: tahomapl i've got an error - FPDF error: Undefined font: tahomapl. What did I do wrong?

12

juste read fpdf tutorial...

http://www.fpdf.org/en/tutorial/tuto7.htm
Ancien pseudo : lolo

13

I read this topic but this doesn't work. I created this fonts with iso-8852-2 codepage.
I copy the arialpl.php, arialpl.z, arialpl.afm into the _fpdf/fonts folder and if i put code line
$pdf->AddFont('arialpl');
i've got

Fatal error: Call to undefined function: addfont() in E:\WWW\chlist\html2pdf\exemples\ch.php on line 48

What should I do?

14

the addfont methodis in the fpdf class, not in the html2pdf class

try this :

$html2pdf = new HTML2PDF(...)
$html2pdf->pdf->AddFont(...)
Ancien pseudo : lolo

15

Ok it's better, but now I've got this:

Warning: addfont(E:\WWW\chlist\html2pdf\_fpdf/font/tahomapl.php) [function.addfont]: failed to open stream: No such file or directory in E:\WWW\chlist\html2pdf\_fpdf\fpdf.php on line 467

Warning: addfont() [function.include]: Failed opening 'E:\WWW\chlist\html2pdf\_fpdf/font/tahomapl.php' for inclusion (include_path='.;c:\php4\pear') in E:\WWW\chlist\html2pdf\_fpdf\fpdf.php on line 467
FPDF error: Could not include font definition file

16

ok my fault, i've got another name of font... Now adding font works great, but i still have message : FPDF error: Undefined font: arialpl

End of my code is:

<div style="vertical-align: top; width: 60%; font-family: arialpl">ąęśćźżłó ĄĘŚĆŹŻŁÓ</div>

</page>
<?php
$content = ob_get_clean();
require_once(dirname(__FILE__).'/../html2pdf.class.php');
$pdf = new HTML2PDF('P','A4','en');
$pdf->pdf->AddFont('arialpl');
$pdf->pdf->SetDisplayMode(100);
$pdf->WriteHTML($content, isset($_GET['vuehtml']));
$pdf->Output();
?>

17

try to use it only with fpdf, not with html2pdf, to see if the pb is comming from html2pdf or fpdf.

if using the font dont works with fpdf, ask you question on the forum of fpdf.org
Ancien pseudo : lolo