/    Sign up×
Community /Pin to ProfileBookmark

generating pdf file using php

[url]http://www.webdeveloper.com/forum/images/smilies/confused.gif[/url]

i want to generate a pdf file using php but when i used the buit in function of php then some fatal error shows.like function can not be called inside pdf_open_file($pdf, “test.pdf”);these.i can not define any function inside pdf_open_file. so only a page named test.pdf created but no content in the page.

so please if any one can help me then i will be very greatfull.
and also i am sorry for my poor english.

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@knowjNov 19.2007 — Please post your code as its impossible to help you if we don't know what your doing.

I used http://www.fpdf.org/ when i was creating PDF's it was a very easy solution to work with.
Copy linkTweet thisAlerts:
@tanzilaiictauthorNov 21.2007 — Please post your code as its impossible to help you if we don't know what your doing.

I used http://www.fpdf.org/ when i was creating PDF's it was a very easy solution to work with.[/QUOTE]


ya i try with www.fdf.org.but there in code they used a file name

fdf.php.i give the line below.

[COLOR="Red"]require('/yourdirectorywhereFPDFisstored/FPDF/fpdf.php');[/COLOR]

and i can not find the file.so without the required file i can not compile the code.so if u plz help me to find the php file then i will be very thankful to you.
Copy linkTweet thisAlerts:
@JDM71488Nov 21.2007 — FPDF worked for me, too. Put fpdf.php and the font/ folder in the same directory as your PHP file creating the PDF document. Then use this: http://www.fpdf.org/en/tutorial/index.php

EZPDF was also one of my favorites: http://www.ros.co.nz/pdf/
Copy linkTweet thisAlerts:
@knowjNov 21.2007 — ya i try with www.fdf.org.but there in code they used a file name

fdf.php.i give the line below.

[COLOR="Red"]require('/yourdirectorywhereFPDFisstored/FPDF/fpdf.php');[/COLOR]

and i can not find the file.so without the required file i can not compile the code.so if u plz help me to find the php file then i will be very thankful to you.[/QUOTE]


if you put a / infront of a directory you need to define all the directory's back from the root.

/home/users/youruser/httpdocs/fpdf.php

where as if your fpdf.php is in the same directory or a parent directory you will just be able to put 'fpdf.php' or 'includes/fpdf.php'

My terminography is incorrect but you should get the idea
Copy linkTweet thisAlerts:
@tanzilaiictauthorNov 22.2007 — Thanks to both of you guys.but i think i can not make you understand my problems.or may be i am not understanding your sugetions.

suppose i go fpdf.org and have some code like this

<?php

require('fpdf.php');

$pdf=new FPDF();

$pdf->AddPage();

$pdf->SetFont('Arial','B',16);

$pdf->Cell(40,10,'Hello World!');

$pdf->Output();

?>

now i will store this code in my localhost/htdocs/mine/test.php

file.and when i try to run it from a browser(like:http://locahost/mine/test.php) then it says that it need fpdf.php file.and here is my problem that where i can find this fpdf.php file.

may be it is too easy to understand the code but plz forgive me for my ill-letaracy.and plz explain the code with the require file and it's code.

And Again thanks to both of u guys for both of your valuable concern.
Copy linkTweet thisAlerts:
@hastxNov 22.2007 — The way your require statement is written, you need to have the "fpdf.php" file in the same directory as your "test.php" file.

If fpdf.php is not in your "mine" folder, the script can't find it.
Copy linkTweet thisAlerts:
@felgallNov 22.2007 — Either you haven't downloaded and installed the fpdf.php file or you installed it in the wrong place.
×

Success!

Help @tanzilaiict spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...