Export .php to pdf(with table)

Reply

Join Date: Sep 2009
Posts: 24
Reputation: lcyew is an unknown quantity at this point 
Solved Threads: 0
lcyew lcyew is offline Offline
Newbie Poster

Export .php to pdf(with table)

 
0
  #1
Oct 11th, 2009
Hi.

I'm doing exporting from .php to .pdf now and face a little problem here.

I've found something like below and I think it might be helpful for me to do exporting to pdf.

  1. <?php
  2. $mypdf = PDF_new();
  3. PDF_open_file($mypdf, "");
  4. PDF_begin_page($mypdf, 595, 842);
  5. $myfont = PDF_findfont($mypdf, "Times-Roman", "host", 0);
  6. PDF_setfont($mypdf, $myfont, 10);
  7. PDF_show_xy($mypdf, "Sample PDF, constructed by PHP in real-time.", 50, 750);
  8. PDF_show_xy($mypdf, "Made with the PDF libraries for PHP.", 50, 730);
  9. PDF_end_page($mypdf);
  10. PDF_close($mypdf);
  11. PDF_delete($mypdf);
  12. ?>

However, in my .php file, it's including display of table. (and I cant get anything about that in tutorials I've found so far)

How can I do to have the table in pdf?

Thanks in advance. Have a nice day =P
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,080
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster
 
0
  #2
Oct 12th, 2009
Originally Posted by lcyew View Post
Hi.

I'm doing exporting from .php to .pdf now and face a little problem here.

I've found something like below and I think it might be helpful for me to do exporting to pdf.

  1. <?php
  2. $mypdf = PDF_new();
  3. PDF_open_file($mypdf, "");
  4. PDF_begin_page($mypdf, 595, 842);
  5. $myfont = PDF_findfont($mypdf, "Times-Roman", "host", 0);
  6. PDF_setfont($mypdf, $myfont, 10);
  7. PDF_show_xy($mypdf, "Sample PDF, constructed by PHP in real-time.", 50, 750);
  8. PDF_show_xy($mypdf, "Made with the PDF libraries for PHP.", 50, 730);
  9. PDF_end_page($mypdf);
  10. PDF_close($mypdf);
  11. PDF_delete($mypdf);
  12. ?>

However, in my .php file, it's including display of table. (and I cant get anything about that in tutorials I've found so far)

How can I do to have the table in pdf?

Thanks in advance. Have a nice day =P
What PDF library are you using? They should have documentation on how to include HTML.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC