Java API to Render EML to XPS
Export EML to XPS by using on premise Java API without using any third party dependencies
How to Render EML to XPS Using Java
Email conversion is a powerful feature that Java developers can integrate within any Java J2SE, J2EE, J2ME applications via Aspose.Total for Java . By using two APIs within the package you can convert Email EML to XPS without any third party dependencies. Firstly, you can use Email Manipulation API Aspose.Email for Java to convert EML file format to HTML. Secondly, you can render HTML to XPS by using Document Processing API Aspose.Words for Java .EML to XPS Conversion on Java
- Open EML file using MailMessage class
- Convert EML to HTML by using save method
- Load HTML by using Document class
- Save the document to XPS format using save method and set XPS as SaveFormat
Get Started with Java File Format APIs
You can easily use Aspose.Total for Java directly from a Maven based project and include Aspose.Words for Java and Aspose.Email for Java in your pom.xml.
Alternatively, you can get a ZIP file from downloads .
Java Code for EML to XPS Rendering
MailMessage message = MailMessage.load("sourceFile.eml");
// save EML as a HTML
message.save("HtmlOutput.html", SaveOptions.getDefaultHtml());
// load HTML with an instance of Document
Document document = new Document("HtmlOutput.html");
// call save method while passing SaveFormat.XPS
document.save("output.xps", SaveFormat.XPS);
EML What is EML File Format?
EML file format represents email messages saved using Outlook and other relevant applications. Almost all emailing clients support this file format for its compliance with RFC-822 Internet Message Format Standard. Microsoft Outlook is the default software for opening EML message types. EML files can be used for saving to disc as well as sending out to recipients using communication protocols.
Read MoreXPS What is XPS File Format?
An XPS file represents page layout files that are based on XML Paper Specifications created by Microsoft. It was developed as a replacement of EMF file format and is similar to PDF file format, but uses XML in layout, appearance, and printing information of a document. It is, in fact, more justified to say that XPS is an attempt on PDF, but couldn’t get enough popularity as owned by PDF for many reasons. Microsoft provides XPS Document Writer by default from Windows 7 onwards for the creation of XPS files. XPS files can be generated by selecting the Microsoft XPS Document Writer as printer while printing the document.
Read More