Solved

how to make pdf using php and fpdf  that support special font

Posted on 2010-09-06
6
3,407 Views
Last Modified: 2013-12-13
hi all,
i have downloaded fpdf class from http://fpdf.org/ and tested it it works fine but it cann't make arabic text or using special font like kasct poster when it try it i get the following error

Warning: FPDF::include(./kacstposter.php) [function.FPDF-include]: failed to open stream: No such file or directory in /data/html/work/php_good_parts/fpdf16/fpdf.php on line 467

Warning: FPDF::include() [function.include]: Failed opening './kacstposter.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /data/html/work/php_good_parts/fpdf16/fpdf.php on line 467
FPDF error: Could not include font definition file

what is the font definition file is and how can i get it for a certain font

can you please guide me
thanks in advance

shangyhi2000
0
Comment
Question by:shangyhi2000
6 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
Comment Utility
This page shows how to make it work: http://fpdf.org/en/tutorial/tuto7.htm
0
 
LVL 3

Assisted Solution

by:ovi_mihai
ovi_mihai earned 100 total points
Comment Utility
Download the ttp2pt1 from: http://www.fpdf.org/fr/dl.php?id=22

you have to create some files (afm, php and z) with a line like

ttf2pt1 -a yourfont.ttf yourfont

put the files you got in the same folder as the folowing script
then write a script
<?php
define('FPDF_FONTPATH','./');
require('fpdf.php');

$pdf=new FPDF();
$pdf->AddFont('Calibri','','calibri.php');
$pdf->AddPage();
$pdf->SetFont('Calibri','',35);
$pdf->Cell(0,10,'Enjoy new fonts with FPDF!');
$pdf->Output();
?>

like dave said, read from the tutorial, i've tested it and it works.

see turorial/tuto7.html and tutorial/tuto7.php  from the zip file yo already got
0
 
LVL 7

Assisted Solution

by:Vimal DM
Vimal DM earned 300 total points
Comment Utility
Hai,

1) There are PDF classes are available to export the records into PDF
2) And there are FPDF + PDF classes are available to make the entries to the PDF templates,which will give the PDF Template as FPDF then using an exe can convert the FPDF to PDF.

If you want can give u the implemented soruce

Thanks.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:shangyhi2000
Comment Utility
dear DaveBaldwin, ovi_mihai, vimalmaria,
i tryed what you said but when i try the attached code it display garbage
also when i try makefont.php i get warnings here it is :

Warning: character hyphen is missing
Warning: character Euro is missing
Warning: character afii57506 is missing
Warning: character dagger is missing
Warning: character daggerdbl is missing
Warning: character afii57511 is missing
Warning: character afii57507 is missing
Warning: character afii57508 is missing
Warning: character afii57512 is missing
Warning: character afii57509 is missing
Warning: character emdash is missing
Warning: character afii57513 is missing
Warning: character afii61664 is missing
Warning: character afii301 is missing
Warning: character afii57514 is missing
Warning: character afii57388 is missing
Warning: character hyphen is missing
Warning: character mu is missing
Warning: character afii57403 is missing
Warning: character afii57407 is missing
Warning: character afii57409 is missing
Warning: character afii57410 is missing
Warning: character afii57411 is missing
Warning: character afii57412 is missing
Warning: character afii57413 is missing
Warning: character afii57414 is missing
Warning: character afii57415 is missing
Warning: character afii57416 is missing
Warning: character afii57417 is missing
Warning: character afii57418 is missing
Warning: character afii57419 is missing
Warning: character afii57420 is missing
Warning: character afii57421 is missing
Warning: character afii57422 is missing
Warning: character afii57423 is missing
Warning: character afii57424 is missing
Warning: character afii57425 is missing
Warning: character afii57426 is missing
Warning: character afii57427 is missing
Warning: character afii57428 is missing
Warning: character afii57429 is missing
Warning: character afii57430 is missing
Warning: character afii57431 is missing
Warning: character afii57432 is missing
Warning: character afii57433 is missing
Warning: character afii57434 is missing
Warning: character afii57440 is missing
Warning: character afii57441 is missing
Warning: character afii57442 is missing
Warning: character afii57443 is missing
Warning: character afii57444 is missing
Warning: character afii57445 is missing
Warning: character afii57446 is missing
Warning: character afii57470 is missing
Warning: character afii57448 is missing
Warning: character afii57449 is missing
Warning: character afii57450 is missing
Warning: character afii57451 is missing
Warning: character afii57452 is missing
Warning: character afii57453 is missing
Warning: character afii57454 is missing
Warning: character afii57455 is missing
Warning: character afii57456 is missing
Warning: character afii57457 is missing
Warning: character afii57458 is missing
Warning: character afii299 is missing
Warning: character afii300 is missing
Warning: character afii57519 is missing
Font file compressed (kacst.z)
Font definition file generated (kacst.php)

attached the code and the font at   http://softpro.bz/test.zip
0
 
LVL 7

Accepted Solution

by:
Vimal DM earned 300 total points
Comment Utility
Hai,

You may look at the following url,download the source and see what is done there,you may get some ideas out of it.

http://www.ros.co.nz/pdf/

Thanks,
0
 

Author Closing Comment

by:shangyhi2000
Comment Utility
answer is not responsive
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now