user2630415
user2630415

Reputation: 11

HTML table to pdf

I am generating class schedule out of SQL queries concerning more than one tables from database. The schedule is displayed in an HTML table on the web page, along with it there are also some one line details about schedule besides the table. I want the user to be able to print this information/ save it in PDF format. So how would I be able to do that?

I think that the PHP or html code would not be necessary for answering this.

Upvotes: 1

Views: 6936

Answers (3)

Daniel Cata
Daniel Cata

Reputation: 50

use TCPDF

include("tcpdf.php");
$html = "html code";

$pdf = new TCPDF();
$pdf->AddPage();
$pdf->writeHTML($html)

Upvotes: 2

keune
keune

Reputation: 5795

I choose DOMPDF to convert html to pdf. It's quite good, free and easy to use.

Upvotes: 0

larrylampco
larrylampco

Reputation: 597

I use PrinceXML if I need to be able to convert something to PDF. It's not free, but it is very easy to use.

Upvotes: 0

Related Questions