All Projects → omnius-project → kMD2PDF

omnius-project / kMD2PDF

Licence: MIT license
Markdown to PDF conversion library written in Kotlin

Programming Languages

kotlin
9241 projects
HTML
75241 projects

Projects that are alternatives of or similar to kMD2PDF

markdown articles tool
Parse markdown article, download images and replace images URL's with local paths
Stars: ✭ 37 (+164.29%)
Mutual labels:  markdown-to-html, markdown-converter, markdown-to-pdf
github-flavored-markdown-to-html
Convert markdown to HTML using the GitHub API and some additional tweaks with Python. Comes with full formula support and image compression.
Stars: ✭ 44 (+214.29%)
Mutual labels:  markdown-to-html, markdown-to-pdf
MarkdownIt
Efficient Code Editor to live render Markdown and save as Markdown,Html and Pdf with Instant Hosting in The Web.
Stars: ✭ 31 (+121.43%)
Mutual labels:  markdown-to-html, markdown-to-pdf
Mditor
📝 [ M ] arkdown + E [ ditor ] = Mditor
Stars: ✭ 523 (+3635.71%)
Mutual labels:  markdown-to-html, markdown-converter
Markitdown
📱 A React app to preview and edit Markdown✍. You can also export it as HTML.
Stars: ✭ 26 (+85.71%)
Mutual labels:  markdown-to-html, markdown-converter
Markdown
📖Clean & Modern MarkDown Generator, 🔌Offline Support and Easy Generation of Markdown ⚡️⚛️ https://github.com/JP1016/Markdown-Electron/releases
Stars: ✭ 170 (+1114.29%)
Mutual labels:  markdown-to-html, markdown-converter
Markdown
A super fast, highly extensible markdown parser for PHP
Stars: ✭ 945 (+6650%)
Mutual labels:  markdown-to-html, markdown-converter
Flexmark Java
CommonMark/Markdown Java parser with source level AST. CommonMark 0.28, emulation of: pegdown, kramdown, markdown.pl, MultiMarkdown. With HTML to MD, MD to PDF, MD to DOCX conversion modules.
Stars: ✭ 1,673 (+11850%)
Mutual labels:  markdown-to-html, markdown-to-pdf
Macdown
Open source Markdown editor for macOS.
Stars: ✭ 8,855 (+63150%)
Mutual labels:  markdown-to-html, markdown-converter
Mdtool
A tool which can process markdown to HTML
Stars: ✭ 136 (+871.43%)
Mutual labels:  markdown-to-html, markdown-converter
mdconv
A CLI markdown converter written in Go, that does not depend on LaTeX.
Stars: ✭ 42 (+200%)
Mutual labels:  markdown-to-html, markdown-to-pdf
dump-env
A utility tool to create .env files
Stars: ✭ 81 (+478.57%)
Mutual labels:  travis-ci
2bbcode
A set of custom Pandoc writers for converting to BBCode.
Stars: ✭ 19 (+35.71%)
Mutual labels:  markdown-converter
koshry
Run on CI, Apply Rules on the Build and Get the Result back to the Pull Request.
Stars: ✭ 59 (+321.43%)
Mutual labels:  travis-ci
travis
⛔ ARCHIVED ⛔ Set Up 'Travis' for Testing and Deployment
Stars: ✭ 61 (+335.71%)
Mutual labels:  travis-ci
cpp14-project-template
A simple, cross-platform, and continuously integrated C++14 project template
Stars: ✭ 64 (+357.14%)
Mutual labels:  travis-ci
from-travis-to-github-actions
👨🏻‍🔧 ➡ 🤖
Stars: ✭ 49 (+250%)
Mutual labels:  travis-ci
archlinux
Archlinux docker image from scratch (built daily by travis cronjob)
Stars: ✭ 79 (+464.29%)
Mutual labels:  travis-ci
terminalplot
No description or website provided.
Stars: ✭ 40 (+185.71%)
Mutual labels:  travis-ci
firebase-ci
Simplified Firebase interaction for continuous integration
Stars: ✭ 71 (+407.14%)
Mutual labels:  travis-ci

Build Status GitHub license Website shields.io Maven Central

Simple and highly customizable markdown to PDF conversion library

Note: Version 0.2.x has been released! Check out the changelog to see what's new!

Jump To

  1. Installation Guide
  2. Quick Start Guide
  3. Previews

Installation Guide

The repository is hosted on Maven Central. You can add it to your project using the following code based on your build tool:

Maven

<dependency>
  <groupId>com.github.woojiahao</groupId>
  <artifactId>kMD2PDF</artifactId>
  <version>0.2.2</version>
</dependency>

Gradle

implementation 'com.github.woojiahao:kMD2PDF:0.2.2'

If you encounter errors with loading the library, visit the troubleshooting guide here.

Quick Start Guide

All examples are taken from the examples repository.

val document 
  get() = MarkdownDocument("resources/markdown-all-in-one.md")

Default styling

Example here.

fun main() {
  val converter = markdownConverter {
    document(document)
  }
  converter.convert()
}

Specifying PDF location

Example here.

fun main() {
  val converter = markdownConverter {
    document(document)
    targetLocation("${System.getProperty("user.home")}/Desktop/exported.pdf")
  }
  converter.convert()
}

Conversion success

Example here.

fun main() {
  val converter = markdownConverter {
    document(document)
  }
  val conversionResult = converter.convert()
  conversionResult.success {
    if (Desktop.isDesktopSupported()) Desktop.getDesktop().open(it)
  }
}

Conversion failure

Example here.

fun main() {
  val converter = markdownConverter {
    document(document)
  }
  val conversionStatus = converter.convert()
  conversionStatus.failure {
    if (it is FileNotFoundException) println("File is currently already open")
  }
}

Custom styling using style DSL

Example here.

More on this subject can be found on the documentation site here.

fun main() {
  val converter = markdownConverter {
    document(document)

    settings {
      fontSize = 16.0.px
      font = FontFamily("Roboto", "Lato")
      monospaceFont = FontFamily("Fira Code")
    }

    style {
      p {
        textColor = c("455A64")
      }

      ul {
        listStyleType = SQUARE
      }

      selector("tr:nth-child(even)") {
        "background-color" to "#f2f2f2"
      }
    }
  }
  converter.convert()
}

Exporting to HTML

Example here.

More on the subject here.

fun main() {
  val converter = markdownConverter {
    document(document)
    conversionTarget(MarkdownConverter.ConversionTarget.HTML)
  }
  converter.convert()
}

Previews

Sample document

Dark theme

Auto-generated table of contents

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].