fpdf error

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
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

fpdf error

Post by junjustkim »

hi to all

I have a a two pages forms and i want to convert it in pdf so that the user have an option to print or save, I have any idea to do this and I search it in google. I found out fpdf and I tested the tutorial1 even I am not sure if it is the one I needed. Please see the error. I already copied the fpdf on the folder html2pdf. Please give me any idea or suggestion

thanks in advance

Warning: FPDF::include(helveticab.php) [function.FPDF-include]: failed to open stream: No such file or directory in C:\xampp\htdocs\infinity_other\html2pdf\fpdf.php on line 507

Warning: FPDF::include() [function.include]: Failed opening 'helveticab.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\infinity_other\html2pdf\fpdf.php on line 507
FPDF error: Could not include font metric file

Code: Select all

<?
require('html2pdf/fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Re: fpdf error

Post by Phoenixheart »

From the last time I work with fpdf, it required font files which are not included in the downloaded package by default. In this case, it looks like you don't have Helvetica font metric files :).
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

Re: fpdf error

Post by junjustkim »

thanks for your immediate replied, how can I fixed this problem, Where can I get this font, or do I have edit the program itself.

thank you so much and please give me a help


thank you
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Re: fpdf error

Post by Phoenixheart »

I'm not quite familiar with this fpdf thing, but anyway here is a link to convert normal .TTF font files into PDF font files for this purpose (Never tried it before, as I remember there is a library to do it too).

Code: Select all

http://fpdf.fruit-lab.de/
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

Re: fpdf error

Post by junjustkim »

what do you mean by converting font into pdf? does it means that the error I've encountered is possible to workout using this. Please bear with me because I am not so familiar with this environment. thanks for your effort and time

Thank You
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Re: fpdf error

Post by Phoenixheart »

No, I'm not telling you to convert fonts into PDF. What we need to do is converting fonts into the format that fpdf can understand and use for its pdf generating purpose. For an example, to be able to write a line in Tahoma into the pdf file, fpdf must have the information about Tahoma font. There are tools to convert a normal true type font into formats that fpdf can understand and use.
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

Re: fpdf error

Post by junjustkim »

ok thans a lot.

Cheers

Tirso :oops:
Post Reply