Hello,
we use Aspose to transform EML files to PDF. According to Aspose samples and documentation, tt requires to transform the EML file to MHTML first, then open it with Aspose.Words as a document and save to PDF then.
By doing that on the attached mail, the exception: “java.lang.IllegalArgumentException: The image format is unsupported” has been raised by Aspose.Words (version 11.5.0) on this code:
import com.aspose.email.MailMessage;
import com.aspose.email.MailMessageSaveType;
import com.aspose.email.MessageFormat;
import com.aspose.words.Document;
import com.aspose.words.SaveFormat;
MailMessage message = MailMessage.load("test.eml",
MessageFormat.getEml());
System.out.println("Saving message in MHTML format....");
File file = File.createTempFile(String.valueOf(new Date().getTime()),
".mhtml");
// Save the message in MHTML format
message.save(file.getAbsolutePath(), MailMessageSaveType
.getMHtmlFromat());
System.out.println("Loading MHTML file in Aspose.Words for Java....");
new Document(file.getAbsolutePath())
In attachment you'll find:
- test.eml.zip: EML File used for transformation (zipped)
- StackTrace.txt: Exception stack trace
Best regards
Vitali
Hi Vitali,
Thank you for contacting support.
I have evaluated your scenario and I am getting the same exception (java.lang.IllegalArgumentException) while converting the Mhtml to Pdf while using Aspose.Words for Java v11.5.0. As the exception was caused by Aspose.Words component, therefore I am going to forward you inquiry to Aspose.Words forum for further analysis.
PS: Attached is the output Mhtml file for your reference.
Regards,
Hi Vitali,
Thanks
for your query. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-6585 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.
We apologize for your inconvenience.
The issues you have found earlier (filed as WORDSNET-6585) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.