TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 09-11-2009, 10:21 AM   #1 (permalink)
The Contributor
 
dhaval's Avatar
 
Join Date: Jul 2009
Posts: 37
Thanks: 1
dhaval is on a distinguished road
Default Create pdf

Hi friends,

I am trying to create pdf through php
even i've done all the step which is necessary
before to create pdf file through php
below is my code for creating

$user=$HTTP_POST_VARS['userName'];
$pdf=pdf_new();
pdf_open_file($pdf,'F:\Program Files\xampp\htdocs\Dhaval\Dhaval.pdf');
pdf_set_info($pdf,"Author",'Dhaval');
pdf_set_info($pdf,'Title','All Rounder');
pdf_set_info($pdf,'All Rounder','Dhaval');
pdf_set_info($pdf,'subject','Success');
pdf_begin_page($pdf,595,842);
$arial=pdf_findfont($pdf,'Arial','host',1);
pdf_setfont($pdf,$arial,14);
$jpg_image=pdf_open_jpeg($pdf,'chess-en.jpg');
pdf_place_image($pdf,$jpg_image,200,300,1.0);
pdf_close_image($pdf,$jpg_image);
pdf_end_page($pdf);
pdf_close($pdf);
echo "<a href='F:\Program Files\xampp\htdocs\Dhaval\Dhaval.pdf'>Open PDF in new window</a>";

but it shows below error

Fatal error: Uncaught exception 'PDFlibException' with message 'Metrics data for font 'Arial' not found' in F:\Program Files\xampp\htdocs\Dhaval\pdf_file.php:10 Stack trace: #0 F:\Program Files\xampp\htdocs\Dhaval\pdf_file.php(10): pdf_findfont(Resource id #2, 'Arial', 'host', 1) #1 {main} thrown in F:\Program Files\xampp\htdocs\Dhaval\pdf_file.php on line 10

so please help me to solve it.
dhaval is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a gallery class Tanax Advanced PHP Programming 25 02-19-2013 04:25 AM
How to create back up ? digitak Advanced PHP Programming 10 05-03-2009 02:03 PM
Create your own advanced WYSIWYG editor almsamim Javascript, AJAX, E4X 8 10-23-2008 06:41 PM
How easy is it to create RSS feeds? Brook Absolute Beginners 4 02-03-2008 08:10 PM
Need your feedback Tanax Absolute Beginners 29 10-11-2007 04:50 PM


All times are GMT. The time now is 03:21 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design