# markdown2pdf **Repository Path**: xieguigang/markdown2pdf ## Basic Information - **Project Name**: markdown2pdf - **Description**: Convert markdown document to html/pdf using VisualBasic in a super easy way! - **Primary Language**: Visual Basic - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-12-22 - **Last Updated**: 2024-04-16 ## Categories & Tags **Categories**: markdown-utils **Tags**: None ## README # MarkdownToPdf  Convert markdown document to html/pdf using VisualBasic in a super easy way! This is a small VB.NET wrapper utility around ``wkhtmltopdf`` console tool. You can use it to easily convert Markdown/HTML reports to PDF. > ``wkhtmltopdf`` cli wrapper code translate from https://github.com/codaxy/wkhtmltopdf. ## Feature - [x] Convert markdown/html document to PDF - [ ] Custom CSS style supports. (Works in progress) - [x] Html template rendering engine for do automatically data analysis report ## How to install + Clone the source code in this repository + Open in VisualStudio 2017 and restore the nuget package ``sciBASIC#`` + compile + Extract ``wkhtmltopdf`` binary distributes from ``./dist/wkhtmltopdf.7z`` package to app release folder + Run app in **cmd/bash** or shell scripting for batch converts of the PDF documents. 
## Usage First of all, please make sure the encoding of your console is UTF8. Utf8 encoding is the default encoding of the html document: ```vbnet Console.InputEncoding = Encoding.UTF8 ``` ### Convert: from URL source ```vbnet PdfConvert.Environment.Debug = False PdfConvert.ConvertHtmlToPdf(New PdfDocument With { .Url = "input.html" }, New PdfOutput With { .OutputFilePath = "output.pdf" }) PdfConvert.ConvertHtmlToPdf(New PdfDocument With { .Url = "input.html", .HeaderLeft = "[title]", .HeaderRight = "[date] [time]", .FooterCenter = "Page [page] of [topage]" }, New PdfOutput With { .OutputFilePath = "output.pdf" }) ``` ### Convert: given html content ```vbnet PdfConvert.ConvertHtmlToPdf(New PdfDocument With { .Html = "
Public Function Main() As Integer
Call println("Hello world!")
Return 0
End Function
1 | 2 | 3 |
---|---|---|
a | b | c |