This gist repository provides ready-to-use Java code snippets from the Converting Between Formats chapter of the Aspose.HTML for Java documentation. The examples demonstrate how to convert HTML, SVG, EPUB, MHTML, and Markdown documents into multiple formats, including PDF, DOCX, XPS, and popular image types. Additionally, it includes examples for fine-tuning converters, giving developers precise control over rendering and output options.
- Convert HTML, SVG, EPUB, MHTML, and Markdown documents into multiple output formats including PDF, DOCX, and images.
- Control every step of the conversion with options for page setup, resolution, background color, and resource management.
- Use the unified Converter API to handle different input formats with the same consistent and reliable workflow.
- HTML Converter – Convert HTML to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, GIF, MD, and MHTML formats.
- SVG Converter – Convert SVG to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF formats.
- EPUB Converter – Convert EPUB to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF formats.
- MHTML Converter – Convert MHTML to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF formats.
- Markdown Converter – Convert MD to HTML, PDF, XPS, DOCX, and image file formats.
- Fine-Tuning Converters – Alternative rendering approaches that allow greater control over conversion settings, including page size, CSS media, background color, resolution, permissions, and stream handling.
- Install the latest version of Aspose.HTML for Java.
- Configure the Aspose repository and add the Aspose.HTML for Java dependency as described in the installation guide.
- Obtain a free trial package and apply a temporary license for full functionality.
- Explore the gists in this repository and copy the code examples relevant to your task.
- Adjust file paths, options, and input data according to your environment before running the samples.
Aspose.HTML for Java is a feature-rich library that enables developers to parse, edit, and convert HTML and related file formats such as SVG, MHTML, XHTML, Markdown, and EPUB. It includes built-in support for CSS, JavaScript, DOM traversal, XPath queries, rendering options, and a variety of export formats, making it a powerful tool for Java applications that require HTML processing.
If you have questions, issues, or suggestions about these examples, please visit the Aspose.HTML Support Forum for help or feedback.
- Official Documentation – Aspose.HTML for Java
- Product page – Aspose.HTML for Java
- Blog – Aspose.HTML Product Family
- API Reference – Aspose.HTML for Java
- Download Evaluation Version
- Free Online Converters – Aspose.HTML
- Java SE 8 (or higher).
- Supported operating systems: Windows, macOS, Linux.
- Java development environment (IntelliJ IDEA, Eclipse, or similar) and a build tool (Maven or Gradle).
- Aspose.HTML for Java library.