SitePoint Sponsor |
|
User Tag List
Results 1 to 19 of 19
Thread: PHP to PDF
-
Jun 28, 2007, 15:43 #1
- Join Date
- Jun 2007
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP to PDF
Hello Everyone,
How do I create a PDF file in PHP that contains the following text "Testing Testing 1,2,3!!!"?
Many Thanks,
-
Jun 28, 2007, 15:53 #2
- Join Date
- Aug 2005
- Posts
- 453
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Documentation @ : http://us2.php.net/pdf
Computers and Fire ...
In the hands of the inexperienced or uneducated,
the results can be disastrous.
While the professional can tame, master even conquer.
-
Jun 28, 2007, 20:38 #3
- Join Date
- Oct 2006
- Location
- Kathmandu, Nepal
- Posts
- 4,013
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you want to use the pre-built libraries then go for some:
http://www.digitaljunkies.ca dompdf which converts html tags to pdf so it is called HTML2PDF too. Also you can use ezpdf class which also does the almost same task. Go to in the http://www.phpclasses.org/ and do make a search there with the keyword ezpdf.
And of course if you want to go through yourself then you can use PHP's library http://www.php.net/pdf
Good luck.Mistakes are proof that you are trying.....
------------------------------------------------------------------------
PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5
-
Jun 28, 2007, 20:45 #4
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Another one to look at is FPDF
http://www.fpdf.org/Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Jul 1, 2007, 12:30 #5
- Join Date
- Jun 2007
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP to PDF
felgall,
I tried this one before, how do I install it?
Many Thanks,
-
Jul 1, 2007, 14:42 #6
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
All I did to install it was to copy the fpdf.php file to my server, add an include statement at the top of the pages where I wanted to use it, and then call the functions as required to generate the content for the file where I wanted it.
The only point where the install became more complex was where I wanted to start using a specific non-standard font for part of the content where I then had to do additional processing to generate the font file in the correct format to use with it.Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Jul 1, 2007, 14:47 #7
- Join Date
- Jun 2007
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jul 30, 2007, 03:10 #8
- Join Date
- Jun 2007
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Php To Pdf
Rajug,
How do I install/use PHP's PDF library http://www.php.net/pdf?
What do I need to do to setup?
-
Jul 30, 2007, 03:22 #9
- Join Date
- Oct 2006
- Location
- Kathmandu, Nepal
- Posts
- 4,013
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you are having PHP5 or upper version, it must be bundled with it just you have to uncomment it in php.ini. Otherwise search for the library and download and put it in the extension directory and it will work when you re-start your web server.
Mistakes are proof that you are trying.....
------------------------------------------------------------------------
PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5
-
Aug 2, 2007, 08:14 #10
- Join Date
- Sep 2005
- Location
- Ukraine, Nikolaev
- Posts
- 231
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Best class to use is TCPDF. Why? It supports Unicode (PDFLib also, but i is not free, I mean completely free and requires to be installed on atarged hosting) and it's better to use thing you can extend in the future. If you don't need Unicode now, are you sure you will not need it forever. And once you need it, you'll come to conclusion that you need TCPDF or install PDFLib on some hosting. And not all hostings support PDFLib and not all hosting allow you to install your programs.
My advice - use TCPDF.
-
Aug 2, 2007, 08:55 #11
- Join Date
- Nov 2005
- Location
- Karachi - Pakistan
- Posts
- 1,134
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
the best is http://www.ros.co.nz/pdf/ i have been using it on simple pdf to complex legal forms. try this its free. AND I CAN BET THAT YOU CAN'T GET ANY THING BETTER !! BECAUSE FOR SOME WORKS, I TRIED MANY php PDFS TOOLS AND CLASSES, EVEN I BOUGHT SOME.
-
Aug 2, 2007, 14:57 #12
- Join Date
- Jun 2007
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP to PDF
zeeshanhashmi,
How do I install/use http://www.ros.co.nz/pdf/
What do I need to do to setup?
-
Aug 2, 2007, 16:09 #13
- Join Date
- Jan 2006
- Location
- UK
- Posts
- 537
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If YOU ACTUALLY READ the page:
"The file readme.pdf contains all of the documentation, it serves triple purpose as the demo file and the testscript. The class download contains everything that you will need to produce this file."
**** READ THE PDF FILE ****
-
Aug 2, 2007, 18:53 #14
- Join Date
- Nov 2005
- Location
- Karachi - Pakistan
- Posts
- 1,134
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yes, and u do not need to INSTALL anything. Just put the class file (2 PHP files) in the same folder where your PDF script will reside. then simply use
include 'php_pdf_class_name.php';
and use that as per the documentation.
Cheers !
-
Aug 3, 2007, 01:00 #15
- Join Date
- Jun 2007
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP to PDF
Terrific!!!
Can I just ask one question?
If you were to use PHP's Built-in PDF Creator, would you need to include a file at the top of the code in order to get it working (Like http://www.ros.co.nz/pdf/) As I tried the built-in PDF creator previously, and couldn't get it to work. Do you have any knowledge why?
-
Aug 4, 2007, 13:40 #16
- Join Date
- Jun 2007
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP to PDF
How do I display data from a database in a PDF? How do I adapt the following?
Code:<?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM person"); while($row = mysql_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "<br />"; } mysql_close($con); ?>
-
Aug 5, 2007, 19:52 #17
- Join Date
- Jan 2006
- Location
- UK
- Posts
- 537
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You don't.
It's apparent you have absolute no capability to listen to advice given time and time again across multiple similar posts.
You also appear to have no desire to actually learn, you just want somebody to do all the work for you.
I'd suggest that you pay somebody to modify scripts for you, as it would appear that programming is not something suited to your mindset.
-
Aug 10, 2007, 06:25 #18
been looking for a pdf solution for a while now. I wonder if some of you could help me.
I used fpdf -> it doesn't work because I need to convert pages on the fly and they have gifs with transparency in them.
I'm a big fan of FOP but my host doesn't do java and memory seems to be an issue for big files.
I can't use pdflib since the ROI is not worth it.
Anyone else been on this search before?
all help is welcome.
-
Aug 11, 2007, 18:34 #19
- Join Date
- Nov 2005
- Location
- Karachi - Pakistan
- Posts
- 1,134
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
http://www.ros.co.nz/pdf/
is all you need !
Bookmarks