PDF from PHP file

They have: 47 posts

Joined: Jun 2001

Hi all,
I have a php page that is basically displaying information from a database according to search criteria. I would like to create a provision for this page to be downloaded as a pdf... is that possible?
I know there are some fuctions in php that create PDFs but it would mean setting up all the tables and so on in php (I am currently setting them up with html and then just calling the database entries with php.) What can I do?
It basically means that each user will be downloading a different pdf file because they will all give different parameters in the search.
Thanks for the help
Mizzy

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

PDF support in PHP is somewhat sporadic. The first thing to do is to make sure that your host has PDF support compiled into the PHP build. I think because it is not a free option and is quite expensive. The easiest way is to do

<?php
phpinfo
();
?>
on a page. It will show you the options that were used to compile PHP.

An alternative would possibly be to make an RTF file that can be opened in Word or other Word Processing Programs.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.