Page 1 of 1

fpdf error

Posted: Wed Jul 30, 2008 3:02 am
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();
?>

Re: fpdf error

Posted: Wed Jul 30, 2008 3:06 am
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 :).

Re: fpdf error

Posted: Wed Jul 30, 2008 3:12 am
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

Re: fpdf error

Posted: Wed Jul 30, 2008 3:21 am
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/

Re: fpdf error

Posted: Wed Jul 30, 2008 3:32 am
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

Re: fpdf error

Posted: Wed Jul 30, 2008 3:40 am
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.

Re: fpdf error

Posted: Wed Jul 30, 2008 5:00 am
by junjustkim
ok thans a lot.

Cheers

Tirso :oops: