-1

Possible Duplicate:
Convert HTML + CSS to PDF with PHP?

I was wondering what are some good tutorials or logic on how to convert HTML and XHTML web pages to PDF using PHP?

Community
  • 1
  • 1
HELP
  • 14,237
  • 22
  • 66
  • 100
  • This is a x-licate, the question has been asked and answered many times on SO and quite extensively discussed. Voting to close. – markus Jan 15 '11 at 19:52
  • This would have been a simple matter of SO search with "php pdf" – markus Jan 15 '11 at 19:53
  • What the hell is with the -1 hater. – HELP Jan 15 '11 at 19:55
  • In no way is this dup since the question tackles the problem in a different way. – HELP Jan 15 '11 at 19:56
  • 3
    Not my downvote, but if you want this to stay open, you will need to explain how your issue differs from the 100000 "HTML to PDF" questions out there. – Pekka Jan 15 '11 at 19:59
  • It's my downvote. I use it, when I think the guidelines have been disregarded. I often remove it, when I think, the question has been improved. In this case, the guidlines have been clearly disregarded, as the OP has not used the search before posting the question. – markus Jan 15 '11 at 20:01
  • @tharkun, well show me a question that explains the logic and points to tutorials on how to create your own PDF using PHP and is not a written class already made buy somebody else? – HELP Jan 15 '11 at 20:06
  • @tharkun I wasn't criticizing the downvote, just pointing out I didn't cast it - it's fine IMO :) @sLuG there is hardly any tutorial for this. As said, this is the kind of thing you need excellent knowledge of both the PDF format and HTML for. You're in for a HUGE lot of work. – Pekka Jan 15 '11 at 20:08
  • edit these specifics into your question, that would be a start... – markus Jan 15 '11 at 20:08
  • @sLuG even the PDF creation classes inherent to PHP were "created by someone else". do you want to learn how to create a PDF from scratch using simple writes to a blank file, or do you want to use a pdf creation class included in PHP? – dqhendricks Jan 15 '11 at 20:09
  • 1
    Reference: Adobe PDF Reference http://www.adobe.com/devnet/pdf/pdf_reference.html – Pekka Jan 15 '11 at 20:10
  • @tharkun, the question already says `what are some good tutorials or logic` you just have to read. – HELP Jan 15 '11 at 20:10
  • yes, and both can be found in the 100000 questions mentioned by pekka. if you really want to write your own implementation of PDF creation with PHP, then you should say so and that would be a crazy and amazing goal and probably a new question and not a duplicate. – markus Jan 15 '11 at 20:12
  • @tharkun again those other question don't answer my question and all point to already created classes. – HELP Jan 15 '11 at 20:14
  • @tharkun well I guess I'll ask the question next which I thought I did but I'll give it a go again. – HELP Jan 15 '11 at 20:16
  • @tharkun before I ask the same question again how should I ask it before you get carried away in down voting again. – HELP Jan 15 '11 at 20:18
  • @sLuG: title>Writing my own HTML to PDF conversion library in PHP; question>I am planning to write my own library to convert (x)html to PDF. I don't really know why I'm planning to take on such an incredibly tedious and complex task, I guess I need a good challenge. I assume I'll learn a lot too. What do I have to consider, where can I find information that gets me started, what are the possible pitfalls, ... – markus Jan 15 '11 at 20:22

1 Answers1

-1

This is FPDF a PHP written class to create PDFs. The logic is pretty straightforward.

  1. Instantiate the FPDF class
  2. Add a page
  3. Render some content
  4. 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();
?>
DarkThrone
  • 1,954
  • 1
  • 14
  • 14