Have a look at wkhtmltopdf
. It is open source, based on webkit and free.
We wrote a small tutorial here.
EDIT( 2017 ):
If it was to build something today, I wouldn't go that route anymore.
But would use http://pdfkit.org/ instead.
Probably stripping it of all its nodejs dependencies, to run in the browser.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…