How to convert an email file (.msg) to PDF using Java

I discussed how to convert a msg/eml file to PDF using C# in this post. Let’s see how to achieve this using Java.

ConversionHandler conversionHandler = new ConversionHandler(Utilities.getConfiguration());
PdfSaveOptions saveOption = new PdfSaveOptions(); 
String guid = fileName;
ConvertedDocument convertedDocumentPath = conversionHandler.<String> convert(guid, saveOption);
convertedDocumentPath.save(fileName + "." + convertedDocumentPath.getFileType());

Enter fullscreen mode Exit fullscreen mode

I used GroupDocs.Conversion for Java API for the conversion process. Have a look at this thread.

原文链接:How to convert an email file (.msg) to PDF using Java

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容