theiskaa / mdPdf

Create PDF with Markdown files (a md to pdf transpiler)
MIT License
16 stars 0 forks source link
markdown markdown-to-pdf md pdf pdf-generator

mdPdf

mdPdf is a versatile command-line tool and library designed to convert Markdown content into pre-styled PDF documents. It supports reading Markdown from a file or directly from a string, offering flexibility for both users and developers.

This project includes both a binary and a library:

Note: This project is currently under active development, with ongoing improvements and new features being added.

Installation

Currently, there isn't a simplified official method to install the command-line tool across platforms. To use it, you can clone the repository and build the project yourself using Cargo:

git clone https://github.com/theiskaa/mdPdf.git
cd mdPdf
cargo build --release

Usage

To use the mdPdf tool, you can either specify a Markdown file path, provide Markdown content directly, or set the output PDF path.

Options

Examples

  1. Convert a Markdown file to a PDF:

    mdp -p "docs/resume.md" -o "resume.pdf"

    This will convert the resume.md file located in the docs folder to a PDF file named resume.pdf.

  2. Convert Markdown content provided as a string:

    mdp -s "# My Markdown Title\n\nThis is content." -o "output.pdf"

    This will convert the provided Markdown string to a PDF file named output.pdf.

  3. Convert a Markdown file to a PDF with default output:

    mdp -p "file.md"

    This will convert the file.md to a PDF and save it as output.pdf.

Notes