Closed ekristen closed 8 years ago
Hi!
Thanks for the pull request.
I have written Dockerfiles mostly with Alpine Linux as base, so I kinda optimized too much for minimal number of layers. As the image is big anyway, optimizing for caching makes sense.
delay
and waitForText
are good to have. I personally haven't rendered any dynamically generated content with this yet - static pages with CSS3 + Webfonts so far.
What do you think about HTTP API being sync? Any problems? I went with this way initially as it keeps things more simple and I'm generating PDFs in a background workers anyway.
Anyway, will merge the PR, clean up some linter errors and release it as 0.5.0. I'll try to get an CI with some integration up too.
Hey Mihkel,
Thanks for the awesome service. We found that with one of our tools, the contents we wanted in the PDF wasn't always ready when the DOM was loaded, so we added a few options.
I also made some improvements to the dockerfile so that the build layers could be cached and not always rebuilt. When making code changes, only the last few layers get updated vs all the apt-get install command running again.
delay
andwaitForText
delay
should be an integer expressed in seconds, when specified the pdf generation will delay until the time is met.waitForText
should be a string that will eventually appear. The application will continually scan until such time the text is found or theTIMEOUT
is reached. Once the text is found the PDF will get generated. This is useful if text is loaded via XHR or websocket requests after the inital dom is ready.