Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.HTML for Java converts Markdown directly to HTML with
Converter.convertMarkdown(). For PDF, XPS, DOCX, or image output, convert Markdown to an HTMLDocument first, then pass that document and the appropriate save options to
Converter.convertHTML().
Markdown is a lightweight plain-text markup language widely used for documentation, README files, and web content. Aspose.HTML for Java supports programmatic Markdown conversion to HTML and, through an intermediate HTML document, to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF.
HTMLDocument.The following example creates a Markdown file, converts it to an HTMLDocument, and then converts the document to PDF with default PdfSaveOptions. The sample uses document.md as input and saves document-output.pdf.
1// Convert Markdown to PDF using Aspose.HTML for Java
2
3// Prepare a simple Markdown example
4String code = "### Hello, World! \n\n" +
5 "[visit applications](https://products.aspose.app/html/applications)";
6
7// Create a Markdown file
8FileHelper.writeAllText("document.md", code);
9
10// Convert Markdown to HTML
11HTMLDocument document = Converter.convertMarkdown("document.md");
12
13// Convert the HTML document to PDF file format
14Converter.convertHTML(document, new PdfSaveOptions(), "document-output.pdf");Download complete Java examples and data files from GitHub.
PdfSaveOptions.ImageSaveOptions.Use the free online Markdown Converter for quick manual conversion to HTML, PDF, XPS, DOCX, or image formats without writing Java code. Use Aspose.HTML for Java when conversion must run programmatically in a Java application.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.