Markdown Converter
Markdown is a general-purpose, plain-text markup language known for its simplicity and widespread use in documentation and web publishing. Its primary purpose is to provide a human-readable syntax that can be easily converted to HTML, the fundamental markup language for web pages.
Aspose.HTML for Java provides a wide range of Markdown conversions to popular formats, such as HTML, PDF, XPS, JPG, PNG, BMP, TIFF, and GIF.
This section provides information on the list of supported Markdown conversions and how to perform them using convertMarkdown()
methods of the
Converter class. It can be different scenarios, but any Markdown conversion can be made with a few required steps:
- Load an existing Markdown file. You can load Markdown from a file or stream.
- Create a SaveOptions object. You may customize the rendering process to get the desired result.
- Use one of the
convertMarkdown()
methods to convert Markown to HTML and pass the required parameters to it. - Call one of the
convertHTML()
methods of the Converter class to convert the HTML to the required output format.
Note: Any conversion from Markdown to other formats goes through the Markdown to HTML conversion stage.
Let’s consider the following code snippet that shows how to convert Markdown to PDF using our Java library:
1// Convert Markdown to HTML
2HTMLDocument document = Converter.convertMarkdown($o("nature.md"));
3
4// Initialize PdfSaveOptions
5PdfSaveOptions options = new PdfSaveOptions();
6
7// Convert the HTML document to PDF file format
8Converter.convertHTML(document, options, $o("nature-output.pdf"));
Popular Markdown Conversions
- Convert Markdown to HTML – Consider various Markdown to HTML conversion scenarios in Java code. Converting Markdown to HTML is an important basic operation because all conversions to other formats go through the Markdown to HTML conversion step.
- Convert Markdown to PDF – Learn how to convert Markdown to PDF using Java library. You can easily use the Java code described here to convert Markdown to PDF, or Markdown to XPS.
- Convert Markdown to Image – Learn how to convert Markdown to Image with Aspose.HTML for Java, and you can easily use the Java code described here to convert Markdown to PNG, JPG, BMP, GIF, and TIFF.
You can download the complete examples and data files from GitHub.
Aspose.HTML provides a free online Markdown Converter that enables you to convert Markdown files to various popular formats. This tool can easily convert Markdown to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF. The conversion process is simple and fast. You don’t need any additional software. The best part is that it’s completely free!