Introducing render-vendor

We just published render-vendor, a faster alternative to wkhtmltopdf when rendering HTML documents to PDFs (or PNGs, JPEGs, BMPs...). With it, you can:

Check it out at http://render-vendor.com.

Background

A client wanted an Electron app to print formatted documents like receipts or stickers. Our proposed solution used html-pdf to render PDFs from HTML files, which would be sent to networked printers.

This first approach benched at ~3s per job, which met requirements but kind of sucked. Users don't like to wait.

On investigation, we found that 90+% of the time was spent waiting for PhantomJS to boot and paint the DOM. Watch the CLI spin:

render-vendor demo gif

We engineered. The project we delivered:

  • Prints jobs in 50ms or less; and
  • Wraps core dependencies with a minimal API that prevents vendor lock-in; by:
    • Booting a PhantomJS Renderer; which
    • Manages a fleet of Pages; each of which
    • load()s a Glimmer app; that
    • Subscribes to data updates over websocket; and
    • May be render()ed to PDF and shipped to the printer at any time.

We're excited to publish the project as render-vendor; we hope Node.js apps and libraries find it useful when reasoning about parallel renderer processes.

We've also published ember-render-vendor, which uses EmberCLI to simplify integration with Ember apps running in Node.js (vs. browser) environments.

aidan nulman

partner @ isle of code. hacks with ember.js & btle (e.g. ibeacons).

About Isle of Code:

We’re a Javascript/Ember firm in Toronto + Chicago, est. 2012. We provide on-demand development for Mobile Apps, Websites, iBeacons/ hardware, existing codebases and team augmentation / Ember leadership.

read more