How to convert URL to PDF?

Overview of a simple API that allows you to convert any webpage to a PDF document
11 October 2017   3600

PDFs can be generated in many ways, but one of them is to convert HTML+CSS content to a PDF. The URL to PDF Microservice just does that. This microservice allows you to render to PDF receipts, invoices, or any other content. 

Features

So, according to the developers, main advantages of this product are:

  • Rendered with Headless Chrome, using Puppeteer. The PDFs should match to the ones generated with a desktop Chrome.
  • Sensible defaults but everything is configurable.
  • Single-page app (SPA) support. Waits until all network requests are finished before rendering. A feature which even most of the paid services don't have.
  • Easy deployment to Heroku. We love Lambda but...Deploy to Heroku button.
  • Renders lazy loaded elements. (scrollPage option)
  • Supports optional x-api-key authentication. (API_TOKENS env var)

Here is an example of usage. 

Scheme of work
Scheme of work

Developers warn that you shouldn't serve this API publicly in the internet unless you are aware of the risks. It allows API users to run any JavaScript code inside a Chrome in the server. It's fairly easy to expose content of files in the server. You have been warned!

Learn more at GitHub.

Frontend News Digest 30.11 - 6.12

How to create a Node.js module, patching your node_modules, Node 13.3.0 released and many other interersting things
06 December 2019   74

Greetings! I hope your week went great! Here's new Frontend news digest.

Learn how to make a better custom select element, "switch it up" with CSS custom properties guide, what's awaits Node.js in 2020 and even more

Guides

  • Making a Better Custom Select Element 

Tutorial on customizing form inputs and keeping them accessible

  • Switch It Up with CSS Custom Properties

The basics of using CSS custom properties particularly with theming

  • How To Create a Node.js Module

Good tutorial on the basic, but valuable thing in Node

  • Patching Your node_modules —

Learn the strategy of patching dependencies in node_modules by using patch files.

Articles

  • What's New for Node.js in 2020

Learn what the next year is preparing for the popular JavaScript runtime environment

Update

  • Got

Human-friendly and powerful HTTP request library for Node.js

  • Node v13.3.0 (Current)

Another update of Node

  • Cockatiel

A resilience and transient-fault-handling library that allows to express policies such as Backoff, Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback

  • Enquirer

Good prompts for your command line apps

Video

  • GOTO 2019 • Going Docker, Swarm and Kubernetes Production Like a Pro • Bret Fisher