Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-15-2007, 11:35 PM
Junior Member
 
Join Date: Jul 2007
Posts: 1
Default PDF file with UTF-8 string

Hello, I have problems with display UTF-8 (or another national charmaps, like ISO-8859-2) strings (in czech language, for ex. "ěčř") in PDF file - some chars are not displayed. Please, how can I generate PDF file from UTF-8 strings with national characters?

This is my script:
<?php
include "Zend/Pdf.php";
$pdf = new Zend_Pdf();
$page1 = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);

// Create new font
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HE LVETICA);
// Apply font
$page1->setFont($font, 36);

// I tried 2 ways, but both are bad - some characters are not displayed
$file = fopen("text.txt", "r");
$string = fread($file, filesize("text.txt")); //in text.txt is my "czech" string (bellow)
//$string = 'eěsšcčrřzžyýaáiíeéoó';

$page1->drawText($string, 72, 720, 'UTF-8');

$pdf->pages[] = $page1;
$pdf->save("test.pdf");
?>

THX for your HELP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-24-2007, 06:55 AM
noHuman's Avatar
Junior Member
 
Join Date: Aug 2007
Posts: 2
Default

Hi!
No sure, but I think you need UNICODE fonts, embebed into PDF or avaibles in reader machine....any idea...sorry

noHuman
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:36 AM.