0

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

I have a website developed using HTML, CSS and javascript/jQuery. I need to convert a webpage to PDF format ( or any other printable version). How can this be done?

Community
  • 1
  • 1
user1403848
  • 103
  • 2
  • 4
  • 15
  • I wanna know whether this can be performed without using PHP – user1403848 Nov 07 '12 at 17:50
  • 1
    Sorry, I misread. I see that your question does not have a PHP tag. In any case, what are you using server-side? I don't believe you will be able to do this client-side. – Brad Nov 07 '12 at 17:55
  • i believe you could do it with java for client side, or some other server side language – Linas Nov 07 '12 at 18:00
  • 1
    @user1403848 did you even look at the answers? Htmldoc (mentioned in the OP) is purely commandline, meaning it can be run from any language that can execute other applications (via PHP's `exec`, Haskell's `system`, etc). Bottom line: you will need to use *some* server side language to do it dynamically, even if it isn't PHP. – cimmanon Nov 07 '12 at 18:09
  • JavaScript using Server-side JavaScript – user1403848 Nov 07 '12 at 18:17

2 Answers2

1

...any other printable version. Why not to do just special css and html layout with link like «version for print»?

paka
  • 1,601
  • 22
  • 35
0

wkhtmltopdf is fantastic and works with any programming language that can run a command line process. You will have to run the it on the server, but IMHO it is the best way to render PDFs from HTML hands down.

Command line:

wkhtmltopdf www.myhomepage.com myhomepage.pdf
jle
  • 9,316
  • 5
  • 48
  • 67