- MHT to Image Conversion – Java API Installation
- Convert MHT to JPG Image Programmatically in Java
- Convert MHT to PNG Image in Java
MHT to Image Conversion – Java API Installation
Aspose.HTML for Java API is an advanced HTML processing API that can be used to create or manipulate HTML, MHTML, and other popular file formats. Simply access the API by downloading its JAR files from the Downloads section or use the below details in the pom.xml file of your application:
<repositories> <repository> <id>snapshots</id> <name>repo</name> <url>http://repository.aspose.com/repo/</url> </repository> </repositories>
<dependencies> <dependency> <groupId>com.aspose</groupId> <artifactId>aspose-html</artifactId> <version>21.12</version> <classifier>jdk16</classifier> </dependency> </dependencies>
Convert MHT or MHTML to JPG Image in Java
You can export an MHT or MHTML webpage to a JPG format image with the following steps:
- Initialize an instance of the ImageSaveOptions class.
- Specify the output format as JPEG or JPG.
- Convert the source MHT or MHTML to a JPG format image using the ConvertMHTML method.
The code snippet below demonstrates how to convert an MHT or MHTML file to a JPG image in Java:
Convert MHT or MHTML to PNG Image Programmatically in Java
You can quickly convert an MHT or MHTML file to a PNG format image by following the steps listed below:
- Instantiate an object of the ImageSaveOptions class.
- Set the output image format as PNG.
- Convert the MHT or MHTML to a PNG image with the ConvertMHTML method.
The following code sample explains how to convert an MHT or MHTML file to an image in PNG format in Java:
Explore Aspose.HTML for Java API
You may visit the documentation section to learn several other features offered by the API.
Get Free License
You can evaluate any of the features offered by the API in its full capacity by getting a free temporary license.
In this article, you have inspected how to convert an MHT or MHTML file to an image in PNG, JPG, or JPEG format using Java. Furthermore, you may raise any of your queries via the forum so that we can assist you effectively.