Hi I am trying to convert msg to pdf and i am getting Error Unknown Source .
i refer below mentioned link for code
Code Snippet
static void EmailToPdf(String emailPath) throws Exception
{
FileInputStream fstream=new FileInputStream(emailPath);
MailMessage eml = MailMessage.load(fstream);
//Save the Message to output stream in MHTML format
ByteArrayOutputStream emlStream = new ByteArrayOutputStream();
eml.save(emlStream, SaveOptions.getDefaultMhtml());
//Load the stream in Word document
com.aspose.words.LoadOptions loadopt = new com.aspose.words.LoadOptions();
loadopt.setLoadFormat(com.aspose.words.LoadFormat.MHTML);
System.out.println("==emlStream==="+emlStream.size());
Document doc = new Document(new ByteArrayInputStream(emlStream.toByteArray()), loadopt);
ByteArrayOutputStream foStream = new ByteArrayOutputStream();
doc.save(foStream, SaveFormat.PDF);
}
=====Code Error===========
java.lang.IllegalArgumentException: Invalid save format requested.
at com.aspose.words.SaveOptions.createSaveOptions(Unknown Source)
at com.aspose.words.Document.zzP(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at topdf.ConvertMsgToPdf.EmailToPdf(ConvertMsgToPdf.java:75)
at topdf.ConvertMsgToPdf.main(ConvertMsgToPdf.java:29)
----Soure Code Attached—
SourceCode_With_Sample_msg_attached.zip (3.0 KB)