Zend_Pdf UTF-8 characters?

I am having problems mapping UTF-8 characters to a PDF file with Zend_Pdf. Here is my code:

// Load Zend_Pdf class include 'Zend/Pdf.php'; // Create new PDF $pdf = new Zend_Pdf(); // Set font $page->setFont(Zend_Pdf_Font::fontWithPath('fonts/times.ttf'), 12); // Draw text $page->drawText('Janko Hraško', 200, 643, 'UTF-8'); 

Downloading the Igm font supports UTF-8 characters. But I get this error "

Note: iconv () [function.iconv]: an illegal character was found in the input line in D: \ data \ o \ Zend \ Pdf \ Resource \ Font \ Type0.php on line 241

+4
source share
2 answers

It is decided:

 $page->drawText('Janko Hraško', 200, 643, 'Windows-1250'); 

For some reason, the Windows-1250 encoding works, but UTF-8 does not work. Strange, but I will use the Windows-1250.

0
source

Using the Helvetica font, your code works!

+1
source

Source: https://habr.com/ru/post/1313165/


All Articles