This repository was archived by the owner on Mar 26, 2024. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork1
Markdown to PDF conversion library written in Kotlin
License
NotificationsYou must be signed in to change notification settings
omnius-project/kMD2PDF
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Simple and highly customizable markdown to PDF conversion library
Note: Version 0.2.x has been released! Check out thechangelog to see what's new!
The repository is hosted onMaven Central. You canadd it to your project using the following code based on your build tool:
<dependency> <groupId>com.github.woojiahao</groupId> <artifactId>kMD2PDF</artifactId> <version>0.2.2</version></dependency>
implementation'com.github.woojiahao:kMD2PDF:0.2.2'
If you encounter errors with loading the library, visit the troubleshooting guidehere.
All examples are taken from theexamples repository.
val document get()=MarkdownDocument("resources/markdown-all-in-one.md")
Examplehere.
funmain() {val converter= markdownConverter { document(document) } converter.convert()}
Examplehere.
funmain() {val converter= markdownConverter { document(document) targetLocation("${System.getProperty("user.home")}/Desktop/exported.pdf") } converter.convert()}
Examplehere.
funmain() {val converter= markdownConverter { document(document) }val conversionResult= converter.convert() conversionResult.success {if (Desktop.isDesktopSupported())Desktop.getDesktop().open(it) }}
Examplehere.
funmain() {val converter= markdownConverter { document(document) }val conversionStatus= converter.convert() conversionStatus.failure {if (itisFileNotFoundException)println("File is currently already open") }}
Examplehere.
More on this subject can be found on the documentation sitehere.
funmain() {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()}
Examplehere.
More on the subjecthere.
funmain() {val converter= markdownConverter { document(document) conversionTarget(MarkdownConverter.ConversionTarget.HTML) } converter.convert()}
About
Markdown to PDF conversion library written in Kotlin
Topics
Resources
License
Code of conduct
Stars
Watchers
Forks
Packages0
No packages published