Can't say it's completely painless due to the imperative nature of the API but it served me well. If you're reading this, thank you maintainers!
Can't say it's completely painless due to the imperative nature of the API but it served me well. If you're reading this, thank you maintainers!
I wouldn't recommend it however if your design is complex, you're on a very tight schedule and you can stomach Webkit. Truth is Gofpdf requires careful coding and testing to make sure you're drawing things in the right places. You draw using simple primitives positioned around the page with a "cursor"; not something that lends itself to pumping out flashy results in little time.
If you want to create something similar, be sure to escape untrusted input though. With an escape function similar to the one in my library. Otherwise it's very easy for an attacker to execute arbitrary commands.
If you just need to post your own HTML/CSS and get a PDF, then I'd recommend DocRaptor [2].