i have Aspose.Total.Java.lic
license.
i’m trying to convert mhtml files to jpg using aspose-html
when i execute below code for mht files < 200kb, the output generates fine.
if i input file >200kb then i receive below error. i’m not able to figure out how can i fix this. Please help
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-html</artifactId>
<version>24.11</version>
</dependency>
String outputFile=fileName+"_Output.jpg";
String fulloutputFilePath=outputDirpath+"/"+outputFile;
FileInputStream inputstream = new FileInputStream(fullfilePath);
ImageSaveOptions options = new ImageSaveOptions(ImageFormat.Jpeg);
options.setVerticalResolution(Resolution.to_Resolution(2000));
options.setHorizontalResolution(Resolution.to_Resolution(2000));
com.aspose.html.converters.Converter.convertMHTML(inputstream, options, fulloutputFilePath);
Exception in thread "main" class com.aspose.html.utils.ms.System.ArgumentException: An element with the same key already exists in the dictionary.
com.aspose.html.utils.ms.System.Collections.Generic.Dictionary.addItem(Unknown Source)
com.aspose.html.utils.Sd.<init>(Unknown Source)
com.aspose.html.utils.Sb.<init>(Unknown Source)
com.aspose.html.utils.Sc.<init>(Unknown Source)
com.aspose.html.utils.Sd.<init>(Unknown Source)
com.aspose.html.utils.Sb.<init>(Unknown Source)
com.aspose.html.utils.Sc.<init>(Unknown Source)
com.aspose.html.rendering.MhtmlRenderer.a(Unknown Source)
com.aspose.html.rendering.MhtmlRenderer.render(Unknown Source)
com.aspose.html.rendering.MhtmlRenderer.render(Unknown Source)
com.aspose.html.utils.hK.a(Unknown Source)
com.aspose.html.utils.hK.b(Unknown Source)
com.aspose.html.utils.hK.b(Unknown Source)
com.aspose.html.converters.Converter.convertMHTML(Unknown Source)