1

Hello.

Firstly, my english not good, i am sorry. I hope you will understand me smile

I should use ISO-8859-9 for my language encode.

I try to use html2pdf project but i get a error.

<?php
require_once("html2pdf.class.php");
$content = "<h2>Some cyrilic characters şiüğçöü</h2>";
$html2pdf = new HTML2PDF("P","A4","tr");
$html2pdf->setEncoding("ISO-8859-9");
$html2pdf->AddFont('Arial','','arial.php');
$html2pdf->pdf->SetFont("Arial");
$html2pdf->WriteHTML($content,false);
$html2pdf->Output("doc.pdf");
?>

If i run this code, i get this error message:

Warning: html_entity_decode() [function.html-entity-decode]: charset `ISO-8859-9' not supported, assuming iso-8859-1 in C:\xampp\htdocs\html2pdf\html2pdf.class.php on line 1961

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

--

Html2PDF do not support ISO-8859-9?

What can i do? Thank you.

2

for use ISO-8859-9, you have to use a specific font. read this : http://fpdf.org/en/tutorial/tuto7.htm

i have also a wiki that explain how to use it, vut i have some DNS pb sad and the wiki is not avaible at this time sad
Ancien pseudo : lolo

3

Hello Spipu,

I try html2pdf then fpdf.

The line in my code ($html2pdf->AddFont('Arial','','arial.php'); ) is created font for my language. And i use the font (arial.php) in fpdf for iso-8859-9. It is work, no problem. But some arial.php not work in html2pdf class. I hope i tell my problem so my english not good. smile

So, what can i do?

Thank you.

4

so, your arial.php work for iso-8859-9 with fpdf, but not with html2pdf ?
Ancien pseudo : lolo

5

Yes. arial.php (iso-8859-9) work on fdpf but dont work on html2pdf.

Is problem relevance to the line: $html2pdf->setEncoding("ISO-8859-1"); ? So, font is iso-8859-9 but class reparing ISO-8859-1 pdf, then i get chacter problem?

Thank you.

6

it could be that.

coment the lin 1961 of html2pdf.class.php to see if it works
Ancien pseudo : lolo

7

In line 1961 is: $txt = html_entity_decode($txt, ENT_QUOTES, $this->encoding); I add // code after but didnt worked.

Then, I make font again for be sure. Character set work on fpdf true but dont work on html2pdf.

I really need html2pdf class.

If i send my font php (make font for my language charset) can you fix the class work?

Thank you.

8

i can try. send me a email with the php font file, and your html file that dont work
Ancien pseudo : lolo

9

I sent mail to spipu [-at-] spipu.net

Thank you.

10

Is mail reach to you? I havnt news from you.

Thank you.

11

it is not working because you use the setFont method... you have to use CSS style.

try this, it will works :
<?php
require_once("html2pdf.class.php");
$content = '
<page style="font-family: atay; font-size: 16pt">
	ÐÜÞÝÇÖÜ ðüþýçöü
</page>';

$html2pdf = new HTML2PDF('P','A4','tr', 12);
$html2pdf->AddFont('atay','','atay.php');
$html2pdf->WriteHTML($content,false);
$html2pdf->Output("doc.pdf");

Ancien pseudo : lolo

12

Yes, its work. Thank you for your great support and great class.

13

Hi smile

I tested few this kind of scripts and I like html2pdf the best. I want to use it in my aplications but I have a problem with coding. I need to use iso-8859-2 for my language. I tried version v4.01. I did what was recomended ealier in this topic. I converted fonts and put files arialpl.php and arial.z in fonts/ directory.

This is a code I have:
require_once('../html2pdf-v4/html2pdf.class.php');
$html2pdf = new HTML2PDF('L', 'A4', 'pl');
$html2pdf->writeHTML($html); $html2pdf->Output('PDF_file.pdf');


It displays pdf but doesn't show some characters. In tcpdf I used the same php and archive file for fonts and it works fine. Can you please help me to fix it?

14

you have to choose your encoding by using the 5th parameter of the constructor
Ancien pseudo : lolo

15

I changed:
$html2pdf = new HTML2PDF('L', 'A4', 'pl');

to:
$html2pdf = new HTML2PDF('L', 'A4', 'pl', false, 'iso-8859-2');

and I got error
Warning: html_entity_decode() [function.html-entity-decode]: charset `iso-8859-2' not supported, assuming iso-8859-1 in parsingHTML.class.php on line 203

16

Can it be solved?