Easily convert markdown files to PDF

Related tags

Editors ezpdf
Overview

ezPDF

What's this?

This is a simple markdown to pdf parser that supports custom CSS stylesheets.

In the future, ezPDF will allow you to preview files and maybe even edit them in the Browser using markdown.

How can I use it?

Run

npx ezpdf [filename]

Substituting [filename] for the name of the markdown file you want to print as PDF.

For example:

npx ezpdf mylittlefile

Will produce a file named mylittlefile.pdf

This takes a while (about 20~30 seconds) to run, because npx has to temporarily install the Chromium browser.

If you find yourself using the command repeatedly, you may consider installing the package either globally or locally.

Installing locally

If you find yourself converting the same file, you should consider installing the package locally.

Run

npm install ezpdf

or

yarn add ezpdf

Then, you can use npx as usual (npx ezpdf [filename]) to run the package from the local node_modules/bin, and it will run much faster (under 1s usually).

Installing globally

Alternatively, if you find yourself parsing multiple files over different folders, you may want to install the package globally.

In that case, run

npm install -g ezpdf

or

yarn global add ezpdf

Afterwards, you can run

ezpdf [filename]

awywhere to get the same performance as running from a local installation.

How does it work?

ezPDF runs on 3 steps:

  1. Converts the markdown file to HTML using an unified pipeline. During this step, it also extracts YAML configuration from the frontmatter to create the stylesheet and append links to the HTML file head;
  2. Serves the HTML file locally on port 8080 using http-server;
  3. Navigates to the page using puppeteer and prints the PDF file through its headless Chromium browser.

Afterwards, it cleans up the temp folder created during the process.

How can I contribute?

Thanks for the interest! Please, read the CONTRIBUTING file

License

This project uses the classic MIT open-source license, which means you can use anything here for free for any commercial or non-commercial ends, but if you replicate parts of the code, the resulting project must also follow the same license.

It also means this software is provided "as is", with no warranty of any kind.

For more info, read LICENSE.md

You might also like...

A web interface to edit TP-Link Router Config export files (typically named config.bin).

TP-Link Router Config Editor A web interface to edit TP-Link Router Config export files (typically named config.bin). Visit the website. Tested on an

Nov 17, 2022

Browser-based code editor created to edit local or server files online

Browser-based code editor created to edit local or server files online

notIDE Browser-based code editor created to edit local or server files online. Features Autosave while editing Syntax highlight using ace editor Creat

Nov 21, 2022

A VSCode extension that implements outline view and go to definition for Coq files.

A VSCode extension that implements outline view and go to definition for Coq files.

Coq Outline A VSCode extension that provides outline view for Coq files. Features Provide outline views for Coq files. Provide go to definition functi

Oct 29, 2022

PDF.js Read Only is an additional readonly mode for PDF.js

PDF.js Read Only PDF.js Read Only is an additional readonly mode for PDF.js, a Portable Document Format (PDF) viewer that is built with HTML5 which is

Dec 22, 2022

I'm trying to create simple program for adding the digital signature to a pdf file with self-signed certificate. I use node-signpdf and pdf-lib library.

pdf-digital-signature-with-node-signpdf-ejs I'm trying to create simple program for adding the digital signature to a pdf file with self-signed certif

Dec 25, 2022

Markdown Transformer. Transform markdown files to different formats

Mdtx Inspired by generative programming and weed :). So I was learning Elm language at home usually in the evening and now I am missing all this gener

Jan 2, 2023

Chat View let's you quickly and easily create elegant Chat UIs in your Markdown Files.

Chat View let's you quickly and easily create elegant Chat UIs in your Markdown Files.

Obsidian Chat View Plugin Chat View let's you quickly and easily create elegant Chat UIs in your Markdown Files. Usage Every chat message must be pref

Dec 27, 2022

📄 Create PDF files using React

📄  Create PDF files using React

React renderer for creating PDF files on the browser and server Lost? This package is used to create PDFs using React. If you wish to display existing

Jan 7, 2023

Plugin to enable PDF files as first class citizens within an Obsidian vault.

Obsidian-PDF Plugin to enable PDF files as first class citizens within an Obsidian vault. What does this plugin do for me? All PDF files in your vault

Nov 26, 2022

convert markdown to html in under 5kb

convert markdown to html in under 5kb

convert markdown to HTML in under 5kb take a look at the to PHP translated version: https://github.com/SimonWaldherr/micromarkdown.php about License:

Dec 8, 2022

Vite plugin to convert markdown to html with front-matter extraction and build-time syntax highlighting

Vite plugin to convert markdown to html with front-matter extraction and build-time syntax highlighting

Sep 18, 2022

Convert a well formed GitHub Issue Form populated Markdown body into a JSON data file in the repository

Convert a well formed GitHub Issue Form populated Markdown body into a JSON data file in the repository

Sep 28, 2022

Convert Your Kindle highlight & Note to Markdown/JSON

kindle-highlight-to-markdown Convert Your Kindle highlight & Note to Markdown/JSON Install Install with npm: npm install kindle-highlight-to-markdown

Dec 31, 2022

Convert MDX to Markdown.

mdx-to-md Convert MDX to Markdown. Why? This library is most useful for generating README.md files like the one you're reading. Install yarn add mdx-t

Dec 1, 2022

Mercury: easily convert Python notebook to web app and share with others

Mercury: easily convert Python notebook to web app and share with others

Mercury Share your Python notebooks with others Easily convert your Python notebooks into interactive web apps by adding parameters in YAML. Simply ad

Dec 30, 2022

Convert olymp.sty based TeX problem files to BOJ Stack descriptions

boj-description-converter solved-ac.github.io/boj-description-converter Convert UCPC-flavored olymp.sty based TeX problem statements to HTML, complyin

Oct 2, 2022

A tool to convert scw files from Supercell games to Collada (dae) format

SCW Tools This module is intended to convert .scw files from Supercell games to Collada (.dae) format. For a better understanding of SCW file structur

Oct 11, 2022

Markdown Plus is a markdown editor with extra features

Markdown Plus is a markdown editor with extra features

Markdown Plus Markdown Plus ("M+" or "mdp" for short) is a markdown editor with extra features. Online demo: mdp.tylingsoft.com Apps We currently don'

Dec 29, 2022
Comments
  • Split the repository in libs, including an HTTP Client and deploy it to Heroku

    Split the repository in libs, including an HTTP Client and deploy it to Heroku

    By having an HTTP client running on the web, the npx command could simply make a request to this server and get the PDF file as a response.

    Not having to download Chromium would speed up considerably.

    However, we must also keep the option of installing Chromium as a default for local installs and global installs, using the HTTP server only for npx - because that would grant the best performance while also saving network resources by not having to call the client if the user has the package installed.

    opened by heyset 0
  • Implement better error handling

    Implement better error handling

    Currently errors are not catched and just terminates the process abruptly.

    Should have a better way of handling errors, including cleaning up the temp folder if the process fails to complete.

    opened by heyset 0
Owner
Matheus "Set" Inacio
Frontend Developer at Flow Estúdios
Matheus
A React component to view a PDF document

React PDF viewer A React component to view a PDF document. It's written in TypeScript, and powered by React hooks completely. // Core viewer import {

React PDF Viewer 1.4k Jan 3, 2023
Convert json data from editorjs to html elements

EditorJs Data Parser Easyly convert json data from editorjs to html elements Installaton npm i editorjs-data-parser yarn add editorjs-data-parser Supp

Teymur Salimzade 7 Aug 30, 2022
enjoy live editing (+markdown)

Pen Editor LIVE DEMO: http://sofish.github.io/pen Markdown is supported Build status: 0. source code You can clone the source code from github, or usi

小鱼 4.8k Dec 24, 2022
A markdown editor. http://lab.lepture.com/editor/

Editor A markdown editor you really want. Sponsors Editor is sponsored by Typlog. Overview Editor is not a WYSIWYG editor, it is a plain text markdown

Hsiaoming Yang 2.8k Dec 19, 2022
🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.

TOAST UI Editor v3 major update planning ?? ?? ?? TOAST UI Editor is planning a v3 major update for 2021. You can see our detail RoadMap here! GFM Mar

NHN 15.5k Jan 3, 2023
A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.

SimpleMDE - Markdown Editor A drop-in JavaScript textarea replacement for writing beautiful and understandable Markdown. The WYSIWYG-esque editor allo

Sparksuite 9.3k Jan 4, 2023
:notebook: Our cool, secure, and offline-first Markdown editor.

Monod Hi! I'm Monod, the Markdown Editor! Monod is a (relatively) secure and offline-first Markdown editor we have built at TailorDev in order to lear

TailorDev 877 Dec 4, 2022
In-browser Markdown editor

StackEdit Full-featured, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites

Benoit Schweblin 19.9k Jan 9, 2023
A file based wiki that uses markdown

wikmd What is it? It’s a file-based wiki that aims to simplicity. The documents are completely written in Markdown which is an easy markup language th

linbreux 161 Jan 2, 2023
A markdown editor using Electron, ReactJS, Vite, CodeMirror, and Remark

updated: Saturday, 5th February 2022 A modern looking application built with Electron-Vite-React ?? ✨ Markdown Editor Introduction This application s

Kryptonite 5 Sep 7, 2022