I am currently evaluating different libraries for HTML to PDF export. Some of them do implement HTML to PDF conversion, but it is labeled as experimental.
PhantomJS sounds like a solid option, but I don't know for sure if it will be possible to generate the PDF at client side so... is it possible? how?
PhantomJS is a discontinued headless browser used for automating web page interaction. PhantomJS provides a JavaScript API enabling automated navigation, screenshots, user behavior and assertions making it a common tool used to run browser-based unit tests in a headless system like a continuous integration environment.
React JS uses phantom js to render the webpages on server-side b. React JS is a framework c. React JS improves the performance of the applications by using the concept of virtual DOM d. In React JS, the data flow will happen in a single direction 2.
PhantomJS is a headless web browser scriptable with JavaScript. It runs on Windows, macOS, Linux, and FreeBSD. Using QtWebKit as the back-end, it offers fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
No, PhantomJS is a complete standalone browser. If you like to compile PhantomJS with emscripten to JavaScript and then run it in the browser, you can certainly try, but it would be probably hard to do.
The easiest way would be to have a PhantomJS server running that takes the HTML that needs to be rendered and returns the resulting PDF. PhantomJS provides the webserver module for this. Of course, you can use PhantomJS with a proper node.js server through a bridge like phantom.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With