Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can. In my experience, there are very few systems as good at producing accurate renders as well as Chrome. There are a few Chrome/webkit based options.

PhantomJS made the process pretty easy, but that's probably not a good option these days as it's on the way out.

NightmareJS is pretty much the same and can do it (though I haven't tested myself) [0]

If you want to get a little deeper you can use CEF (Chromium Embedded Framework [1 ]. It basically turns Chrome into a library and there are a bunch of projects that build on top of it (eg Electron, which is what NightmareJS uses underneath).

Here's a project that just uses CEF for converting to PDF [2].

[0] https://github.com/segmentio/nightmare#pdfpath-options [1] https://bitbucket.org/chromiumembedded/cef/overview [2] https://github.com/spajak/cef-pdf



For C#, there is also CEFSharp. This is used, for example, by the image(recognition)-driven Kantu automation: https://a9t9.com/kantu/web-automation




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: