PHPLibs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
moiseszaragoza
Forum Commoner
Posts: 87
Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:

PHPLibs

Post by moiseszaragoza »

i am running
PHP Version 5.2.6

http://sbh.mpadusa.com/phpinfo.php

i think that PHPLibs are installed properly as i see

pdf

PDF Support enabled
PDFlib GmbH Binary-Version 7.0.2
PECL Version 2.1.3
Revision $Revision: 1.5.2.4 $



I was trying to run a scrip that i found on a web site

Code: Select all

<?php 
// create handle for new PDF document 
$pdf = pdf_new(); 
 
// open a file 
pdf_open_file($pdf, "mz.pdf"); 
 
// start a new page (A4) 
pdf_begin_page($pdf, 595, 842); 
 
// get and use a font object 
$arial = pdf_findfont($pdf, "Arial", "host", 1); pdf_setfont($pdf, $arial, 10); 
 
// print text 
pdf_show_xy($pdf, "Lets see if this works,", 50, 750); pdf_show_xy($pdf, "than are dreamt of in your philosophy", 50, 730); 
 
// add an image under the text 
$image = pdf_open_image_file($pdf, "jpeg", "shakespeare.jpg"); pdf_place_image($pdf, $image, 50, 650, 0.25); 
 
// end page 
pdf_end_page($pdf); 
 
// close and save file 
pdf_close($pdf); 
?>
But it gives me a corrupted PDF file what can i do?
http://sbh.mpadusa.com/mz.pdf (link to the pdf file)
Thanks
Post Reply