开发者

Create a pdf A4 size from using PHP script

开发者 https://www.devze.com 2023-03-11 02:16 出处:网络
I have tried to use the php script to generate PDF with a simple programme Hello World. I came across following error which I am unable to understand can someone help?

I have tried to use the php script to generate PDF with a simple programme Hello World. I came across following error which I am unable to understand can someone help?

SCRIPT

<?php
require('fpdf.php');

$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>

ERROR:-

Warning: include(helveticab.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\php\PEAR\fpdf.php on line 541

Warning: include() [function.include]: Failed opening 'helveticab.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\php\PEAR\fpdf.php on line 541
FPDF error: Could not includ开发者_如何学编程e font metric file


Make sure there is the file helveticab.php inside C:\xampp\php\PEAR

I believe you can download it here: http://www.phpclasses.org/browse/file/1412.html


I suggest you to give a look to TCPDF ( http://www.tcpdf.org/ ) which is far better than FPDF also because it is actively developed.

In TCPDF for example you can add fonts by creating them: http://www.tcpdf.org/fonts.php

0

精彩评论

暂无评论...
验证码 换一张
取 消