0

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

Please give code for PDF generation using HTML and CSS

Community
  • 1
  • 1
tibin mathew
  • 2,058
  • 10
  • 41
  • 51
  • 1
    Do you want to create a pdf file using just html and css or what are you asking? – griegs Sep 03 '10 at 06:10
  • 1
    Maybe you should add something more specific to the question. – alex Sep 03 '10 at 06:16
  • 1
    This is a duplicate of: http://stackoverflow.com/questions/391005/convert-html-css-to-pdf-with-php – Rowan Sep 04 '10 at 10:06
  • SO is not a magic code-generating machine. Don't just ask people to write the code you need (just google "HTML to PDF generator" if that's what you're after). You don't learn anything by doing that. – Lèse majesté Sep 04 '10 at 10:11

3 Answers3

2

In one of my projects I am using dompdf. Here you can find the code you are looking for.

Mischa
  • 42,876
  • 8
  • 99
  • 111
0

What's your development environment?

I have used iTextSharp with great success. You might want to have a look at it.

Izmoto
  • 1,939
  • 2
  • 17
  • 21
  • The question is tagged php, so I don't think this is useful for him. – Mischa Sep 03 '10 at 06:39
  • New versions of iTextSharp cannot be used in commercial applications (unless you buy a license from them). It's still OK to see it in open source projects, etc. – Rowan Sep 04 '10 at 10:04
  • @captaintokyo my bad, i didn't see the 'php' tag when i posted :-( – Izmoto Sep 06 '10 at 07:49
0

It's not possible to generate a PDF file using just HTML and CSS code. You will need a PHP library that supports converting HTML documents to PDF documents. See this StackOverflow question for some tips.

Community
  • 1
  • 1
Rowan
  • 2,384
  • 2
  • 21
  • 22