A JavaScript-powered CLI for converting HTML into PDFs

Overview

Print Ready

by Nicholas C. Zakas

If you find this useful, please consider supporting my work with a donation.

Description

A JavaScript-powered CLI for converting HTML into PDFs.

EXPERIMENTAL: This project is still in the very early stages and should not be relied upon for production. At this point, I'm just looking for feedback and fixing bugs.

Prerequisites

  • Node.js 12.22+

Usage

Install using [npm][npm] or [yarn][yarn]:

npm install @humanwhocodes/print-ready --save

# or

yarn add @humanwhocodes/print-ready

Then on the command line:

npx print-ready foo.html

This will render foo.html to a file named foo.pdf. You can also override the output filename:

npx print-ready foo.html -o bar.pdf

How It Works

PrintReady uses PagedJS to render your HTML file inside Puppeteer and then exports a PDF from Puppeteer.

Developer Setup

  1. Fork the repository
  2. Clone your fork
  3. Run npm install to setup dependencies
  4. Run npm test to run tests

Acknowledgements

This project is based on PagedJS-CLI, an MIT-licensed project. While not strictly a fork, this project does use some code from PagedJS-CLI.

Frequently Asked Questions

Why don't you just use the PagedJS-CLI?

I tried, but it kept crashing on me and it doesn't appear to be maintained any longer. Rather than giving up, I decided to write my own.

Why haven't you implemented all the features PagedJS-CLI?

For my purposes I don't need all of the features of PagedJS-CLI. However, I'm open to contributions to add those extra features.

Comments
Releases(v0.2.3)
Owner
Human Who Codes
Human Who Codes
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Linkify is a JavaScript plugin for finding links in plain-text and converting them to HTML tags.

Linkify Linkify is a JavaScript plugin. Use Linkify to find links in plain-text and convert them to HTML <a> tags. It automatically highlights URLs, #

Hypercontext 1.5k Dec 27, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A plugin that will automatically download PDFs of zotero items from sci-hub

Zotero Scihub This is an add-on for Zotero and Juris-M that enables automatic download of PDFs for items with a DOI. Quick Start Guide Install Downloa

Ethan Willis 1.9k Jan 8, 2023
Generate tagged PDFs from your Eleventy site

eleventy-plugin-prince-pdf This plugin makes it easy to generate tagged PDFs from webpages in your Eleventy site, using Prince. What this does This pl

null 4 Feb 9, 2022
A JavaScript library for converting to/from Roman numerals.

romanice - Convert to/from Roman numerals A JavaScript library for converting to/from Roman numerals, e.g., 3888 ↔ MMMDCCCLXXXVIII, 38888 ↔ ↂↂↂↁↀↀↀⅮⅭⅭ

Bhargav 6 Jan 3, 2023
A simple cli-app that allows you to divide a YouTube video into multiple separate videos base on a video's time stamps. Powered by pkg and yt-scissors library.

YouTube-Scissors CLI A simple CLI app that allows you to divide a YouTube video into multiple separate videos base on a video's time stamps. This proj

Gabe 23 Nov 8, 2022
🚀 Blazing Fast S3 Powered CDN ✨ Powered By Fastify, S3 Buckets & Docker!

?? WasiCDN Blazing Fast S3 Powered CDN, Powered By Fastify, S3 Compatible Buckets & Docker! Core DockerHub: https://hub.docker.com/r/maximking19/wasic

Maxim 5 Aug 31, 2022
Transmute one JavaScript string into another by way of mutating its AST. Powered by babel and recast.

equivalent-exchange Transmute one JavaScript string into another by way of mutating its AST. Powered by babel and recast. Features Can parse code usin

Lily Scott 51 Jul 9, 2022
The missing CLI for beautiful, interactive API docs powered by with Stoplight Elements

Elements CLI The missing CLI for beautiful, interactive API docs powered by with Stoplight Elements Installation Install using npm as global package:

skriptfabrik GmbH 6 Nov 22, 2022
A simple CLI experiment that writes recommendation of GitHub repository/project in form of tweet. Powered by OpenAI GPT-3.

GitHub Repo Recommendation Writer A simple CLI experiment that writes recommendation of GitHub repository/project in form of tweet. Powered by OpenAI

Viktor Bezdek 5 Jul 18, 2022
GPT-3 powered cli tool to help with bash commands you can't remember

qwery GPT-3 powered cli tool to help with bash commands you can't remember eg $ qw ffmpeg command to transcode mp4 to mov QWERY RESULT: ffmpeg -i inpu

Aaron Peddle 4 Oct 31, 2022
Node-cli-starter - Basic starter kit for building Node CLI applications with TypeScript.

node-cli-starter Minimal starter kit for building Node CLI applications with TypeScript. Getting Started To get started clone repo locally and run npm

Cory Rylan 7 May 17, 2022
A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and configure Typescript on it.

CTSP- Create TS Project A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and conf

Jean Rodríguez 7 Sep 13, 2022
CLI utility that parses argv, loads your specified file, and passes the parsed argv into your file's exported function. Supports ESM/TypeScript/etc out of the box.

cleffa CLI tool that: Parses argv into an object (of command-line flags) and an array of positional arguments Loads a function from the specified file

Lily Scott 9 Mar 6, 2022
A CLI application that allows you to easily grind your Steam items into gems.

Gemify Tool Gemify Tool is a CLI (Command Line Interface) application that allows you to easily convert your Steam items (backgrounds / emoticons) to

Jack Nolddor 3 Jun 17, 2022
curtains.js is a lightweight vanilla WebGL javascript library that turns HTML DOM elements into interactive textured planes.

What is it ? Shaders are the new front-end web developpment big thing, with the ability to create very powerful 3D interactions and animations. A lot

Martin Laxenaire 1.4k Jan 1, 2023
Simple modern JavaScript ES6 library that fetches JSON data into an HTML table which displays nicely within a Bootstrap 4 Card.

Simple modern JavaScript ES6 library that fetches JSON data into an HTML table which displays nicely within a Bootstrap 4 Card. Uses simplenotsimpler/modern-table library.

SimpleNotSimpler 6 Feb 17, 2022