msokk / electron-render-service

Microservice for rendering PDF/PNG/JPEG from HTML with Electron
MIT License
102 stars 31 forks source link

A Few Minor Enhancements #12

Closed ekristen closed 8 years ago

ekristen commented 8 years ago

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.

msokk commented 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.