Greetings... i just got into generating PDF documents with PHP... when i try the following start-on simple example :
<?php
$pdf = pdf_new();
pdf_open_file($pdf,"new.pdf");
pdf_begin_page($pdf,595,842);
$arial = pdf_findfont($pdf,"Arial","arial.ttf",1);
pdf_setfont($pdf, $arial, 10);
pdf_show_xy($pdf,"Hello World!!",50,750);
pdf_end_page($pdf);
pdf_close($pdf);
?>
( note : the font arial.ttf is found in the same dir as this php script )...
I get the following error :
Fatal error: Uncaught exception 'PDFlibException' with message 'Couldn't find encoding 'arial.ttf'' in C:\Program Files\EasyPHP 2.0b1\www\PDF\create.php:9 Stack trace: #0 C:\Program Files\EasyPHP 2.0b1\www\PDF\create.php(9): pdf_findfont(Resource id #2, 'Arial', 'arial.ttf', 1) #1 {main} thrown in C:\Program Files\EasyPHP 2.0b1\www\PDF\create.php on line 9
I use EasyPHP ( php 5th version )... any help would be appreciated 🙂