| | |
Using TCPDF or UFPDF to generate pdf files in php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2005
Posts: 2
Reputation:
Solved Threads: 0
I have been trying to implement UFPDF into my programs which currently use FPDF to generate pdf files. We have changed to use UTF-8 within our system and now must change the pdf generation programs. I have also tried TCPDF and do not seem to be able to get anywhere with either. The following is a simple program that I have been trying to get this working in. I'm currently getting the following error "Could not include font metric file".
<?PHP
include_once("../set_env_pdf.php");
define('FPDF_FONTPATH','ufpdf/font/');
include_once('ufpdf/ufpdf.php');
$pdf=new PDF(P,mm,Letter,true);
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetX(2);
$pdf->SetFont('vera','',12);
$pdf->SetX(5);
$pdf->Cell(0,9,'Hello World',0,0,'L');
$pdf->Ln(3.5);
$pdf->Output();
?>
I am using the fonts that were downloaded with TCPDF (vera.php, vera.z, vera.ctg.z) and they are in the fonts directory 1 down from the ufpdf directory ( This font has been declared in fpdf.php). The program ufpdf.php is in the ufpdf directory. I'm at a loss as to why I keep getting this error and everything I read on it tells me that the font is in the wrong directory but I don't see that as the issue in this case. Any assistance that anyone could offer would be greatly appreciated.
Thanks,
Joanne
<?PHP
include_once("../set_env_pdf.php");
define('FPDF_FONTPATH','ufpdf/font/');
include_once('ufpdf/ufpdf.php');
$pdf=new PDF(P,mm,Letter,true);
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetX(2);
$pdf->SetFont('vera','',12);
$pdf->SetX(5);
$pdf->Cell(0,9,'Hello World',0,0,'L');
$pdf->Ln(3.5);
$pdf->Output();
?>
I am using the fonts that were downloaded with TCPDF (vera.php, vera.z, vera.ctg.z) and they are in the fonts directory 1 down from the ufpdf directory ( This font has been declared in fpdf.php). The program ufpdf.php is in the ufpdf directory. I'm at a loss as to why I keep getting this error and everything I read on it tells me that the font is in the wrong directory but I don't see that as the issue in this case. Any assistance that anyone could offer would be greatly appreciated.
Thanks,
Joanne
![]() |
Similar Threads
- pdf files not opening - help for strange problem (Windows NT / 2000 / XP)
- Web Address For Free Downloading Of Pdf Copy Of A Php Book (PHP)
- pdf files (Windows Software)
- Reading PDF files (Python)
- How to generate PDF using iText library (Java)
- Silent printing of pdf files to a named printer... (Visual Basic 4 / 5 / 6)
- How to generate pdf file automatically at background? (HTML and CSS)
- Entourage Slow sending pdf files (Mac Software)
Other Threads in the PHP Forum
- Previous Thread: checkbox values calculation with PHP
- Next Thread: system login error
Views: 11816 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email error errors file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php phpincludeissue problem query radio random recursion recursive regex remote script search select server sessions shot sms soap source space speed sql structure syntax system table test tutorial update updates upload url validation validator variable video web xml youtube





