Thanks for the great library! I tried it out and got PDF rendering from a URL working locally using the phantom-html-to-pdf module. I went to deploy to my AWS EC2 instance and found that the node phantomjs 1.9.15 doesn't properly load on Amazon Linux. To get around this, I implemented the ability to set a path to the phantomjs binary, which seems to be standard in other libraries that rely on phantom, e.g. https://github.com/brenden/node-webshot.
Tested without setting the new phantomPath option - uses phantomjs 1.9.15, and works on Mac OSX Yosemite 10.10.15.
Tested adding a dependency to phantomjs2 - 2.0.0 and setting the phantomPath to require('phantomjs2').path - works on Mac OSX 10.10.15. I noticed features in phantomjs 2.0, such as web fonts to indicate that it was working.
Tested bundling a custom Amazon Linux binary of phantomjs2 and setting the phantomPath to that on my AWS EC2 instances - works on AWS Elastic Beanstalk with 64bit Amazon Linux 2015.03 v2.0.0 running Node.js
@pofider
Thanks for the great library! I tried it out and got PDF rendering from a URL working locally using the phantom-html-to-pdf module. I went to deploy to my AWS EC2 instance and found that the node phantomjs 1.9.15 doesn't properly load on Amazon Linux. To get around this, I implemented the ability to set a path to the phantomjs binary, which seems to be standard in other libraries that rely on phantom, e.g. https://github.com/brenden/node-webshot.
This change will work standalone for the dedicatedProcess strategy, but relies on https://github.com/pofider/phantom-workers/pull/10 for the server strategy. That will require a new release of https://github.com/pofider/phantom-workers and a change to the version of that dependency in
package.json
.Testing:
phantomPath
option - uses phantomjs 1.9.15, and works on Mac OSX Yosemite 10.10.15.phantomPath
torequire('phantomjs2').path
- works on Mac OSX 10.10.15. I noticed features in phantomjs 2.0, such as web fonts to indicate that it was working.phantomPath
to that on my AWS EC2 instances - works on AWS Elastic Beanstalk with 64bit Amazon Linux 2015.03 v2.0.0 running Node.jsdedicated-process
strategy and thephantom-server
strategy (using changes in https://github.com/pofider/phantom-workers/pull/10)