FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PDF with PHP





quasar
I want to generate a pdf using php. Someone knows how to do it????

thanks Cool
Diablosblizz
A quick google search shows:

http://www.sitepoint.com/article/generate-pdfs-php/
rvec
you should try this one:
http://www.phpclasses.org/browse/package/421.html

I am using it myself since a week or so. The only thing I haven't figured out yet is how to put images in tables.
Radar
I've tried both of those links, and it seems like the PHP libraries aren't installed. Is this just because I'm on Server 3, which occasionally seems to be missing things, or is there something I might have missed? I suppose if anyone has sample code that they have managed to get working on Frihost, that would be awesome, and the fastest way of answering my question.

Thanks.
Radar
Turns out I've just asked what must be a fairly simple/obvious/newbie question - I've realised that I can just download and include the libraries on my own account.

Thanks anyway to anyone who started to read my question and planned to help.
TomS
The second link works without the pdf-lib installed on a server. It's a pdftool itself,so it works also on frihost or an other hoster,that supports php.
pashmina
if you have noticed in google documents, when you hit the print button, it generates in pdf format and then command it be printed
does any one has any idea how it is done?
rvec
making the pdf or the printing?
There's no way you can find out how they make the pdf, but you can do it with the libs posted above. The printing can be done with javascript.
http://www.quackit.com/javascript/javascript_print.cfm
imagefree
in addition to all above, you need to have PDF extension enabled (or need to load at runtime if you have no access to php.ini).
halilibo
i think you can generate pdf files using your php documents like this,
Code:

<?PHP
Header("application/pdf");
.....
.....
.....
?>


or something like this.

you can find more info at [url=http:www.php.net]www.php.net[/url]
imagefree
its

Code:
header('Content-Type: application/pdf');
urtrivedi
You can do it. There are some library availables.
I am using fpdf for php
Steps to enable it are as follows
1) Download fdpf library for php and unzip it and keep it with your php source code folder.
if you are not able to download it. give me your email id I will send you its zip file
2) I am giving you simple code to write a script to generate pdf from php code.

Code:
<?php
   require('../fpdf/fpdf.php');
   $obj=new FPDF();
   $obj->AddPage();
   $obj->SetFont('Arial','B',8);
   //$obj->SetFontSize(7);
   //$obj->SetFontSize(8);
   
   //$y=$obj->GetY();
   //$x=$obj->GetX();
   $x=0;
   $y=0;
   
   $obj->SetFont('Arial','B',8);
   $obj->MultiCell(180,4,'Form No: ',0,'R');
   $obj->setXY(188,10);
   $obj->SetFont('Arial','',8);
   $obj->Cell(20,4, $formno,0,1);
   
   $obj->Image('images/logo.png', 10,10,25,15);
   
   $obj->setXY(50+$x,10+$y);
   $obj->SetFont('Times','B',14);
   $obj->Cell(120,10, "FRIHOST",0,1);
   $obj->output();
?>

You need to place each and every line where ever you want to show in pdf document.
Related topics
How to install PHP and Apache in 5 min on Win98
PHP books and tutorials
Produce a array that is hard to sort for PHP
PHP Form Question
Kinderen fotograferen verboden?
How to make a php page act differently
Building a Product Quoter with PHP and MySQL
Search PDF document from PHP
Is there article for best way to printing web document
PDF Writer software
PHP MySQL report into PDF
PHP Sending Attachment Email
PDF Software
Help displaying pdfs using PHP
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.