PHP - Convert HTML web pages to PDF using PHP [duplicate]
Possible Duplicate:
Convert HTML + CSS to PDF with PHP?
I was开发者_StackOverflow wondering what are some good tutorials or logic on how to convert HTML and XHTML web pages to PDF using PHP?
This is FPDF a PHP written class to create PDFs. The logic is pretty straightforward.
- Instantiate the FPDF class
- Add a page
- Render some content
- Output the result.
Edit: Code example here
<?php
require(’fpdf.php’);
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont(’Arial’,'B’,16);
$pdf->Cell(40,10,’Este es un ejemplo de creacion de un documento PDF con PHP’);
$pdf->Output();
?>
精彩评论