0

I have a problem with converting a web page (web url) to pdf. Some of CSS and the JavaScript not showing as I want >,<.

I've try some open source code like:

  • dompdf
  • html2pdf.fr
  • html2pdf.it (which I've implement it)

The closest result as I want is html2pdf.it, but it's still not enough because some of CSS not showing correctly. Example html2pdf.it

When I try to open pdfcrowd.com, it's show the result what I want.Example pdfcrowd but we must paid for the service and the limitation problem.

I've tried to google and search how to make it prettier, but until know I still didn't got the answer yet. >,<

Is there any other open source similar with them, or other things that I can do for it? I like their concept using url so I can use it with my other web based application using the api or triggered the link.

tutankhamun
  • 880
  • 2
  • 11
  • 21
Garpepi
  • 19
  • 1
  • 6
  • there's no 'pure' comparability between html and pdf it will always take some compromises. –  Mar 29 '15 at 19:54
  • 1
    possible duplicate of [How can I automate HTML-to-PDF conversions?](http://stackoverflow.com/questions/176476/how-can-i-automate-html-to-pdf-conversions) – tutankhamun Mar 29 '15 at 20:50
  • @Dagon i realize that, but the other people (someone like pdfcrowd) can make it prettier and i'm not. that's means i miss something right? – Garpepi Mar 30 '15 at 01:18

2 Answers2

5

HTML to PDF is tricky. I've tried most open source solutions, and they usually fall short in some aspect. If you are willing to pay, I use docraptor.com, a very easy to use SaaS product with a reasonable price model(per month). Internally it uses Prince, which is a very powerful HTML to PDF library, supporting various CSS3 features.

I have no affiliation to Docraptor or PrinceXML, just a happy customer.

Silfverstrom
  • 28,292
  • 6
  • 45
  • 57
3

You can use wkhtmltopdf its a very cool command line tool which makes a PDF from a website or a HTML file.

René Höhle
  • 26,716
  • 22
  • 73
  • 82
  • ah yes, i've try that one too... but i still get the problem with my header and chart problem >,< still looking the solution for it T_T – Garpepi Mar 30 '15 at 01:10