Using Aspose.Total for Java you can easily convert XPS to OTP within any Java J2SE, J2EE, J2ME application. Firstly, by using Aspose.PDF for Java , you can export XPS to PPTX. After that, by using Aspose.Slides for Java PowerPoint Processing API, you can convert PPTX to OTP.
Java API to Convert XPS to OTP
- Open XPS file using Document class
- Convert XPS to PPTX by using save method
- Load PPTX document by using Presentation class
- Save the document to OTP format using
save
method and set
Otp
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.PDF for Java and Aspose.Slides for Java in your pom.xml.
Alternatively, you can get a ZIP file from downloads .
// load XPS file with an instance of Document class
Document document = new Document("template.xps");
// save XPS as PPTX format
document.save("PptxOutput.pptx", SaveFormat.Pptx);
// instantiate a Presentation object that represents a PPTX file
Presentation presentation = new Presentation("PptxOutput.pptx");
// save the presentation as Otp format
presentation.save("output.otp", SaveFormat.Otp);
Open Encrypted XPS File via Java
While loading XPS file format, your document might be password protected. Aspose.PDF for Java allows you open encrypted documents as well. In order to open the encrypted file, you can initialize new instance of the Document class and pass filename and password as arguments.
// open XPS document
Document doc = new Document("input.xps", "Your@Password");
// save XPS as PPTX format
document.save("PptxOutput.pptx", SaveFormat.Pptx);
Save OTP File with Predefined View Type via Java
After converting XPS to OTP, you can also add predefined view type for your presentation. Aspose.Slides for Java provides a facility to set the view type for the generated presentation when it is opened in PowerPoint through the ViewProperties class. The setLastView property is used to set the view type by using the ViewType enumerator.
// instantiate a Presentation object that represents a PPTX file
Presentation presentation = new Presentation("PptxOutput.pptx");
// set view type
presentation.getViewProperties().setLastView((byte) ViewType.SlideMasterView);
// save the presentation as Otp format
presentation.save("output.otp", SaveFormat.Otp);
Explore XPS Conversion Options with Java
What is XPS File Format
XPS is a file format that represents a fixed-layout document, which includes document content and print settings. XPS files are based on the XML Paper Specification, which was developed by Microsoft. XPS files are similar to PDF files, but they are not as widely supported by software and hardware.
Read MoreWhat is OTP File Format
OpenDocument Standard Format (ODF) is an XML-based file format for representing electronic documents such as spreadsheets, charts, presentations and word processing documents. The format is standardized by the Organization for the Advancement of Structured Information Standards (OASIS) and was first adopted by ISO/IEC JTC1 SC34 in 2005. ODF is an open format, meaning that it is not restricted by any copyright or patent.ODF is based on the XML schema of the OpenOffice.org office suite and uses the Zip compression algorithm. It is designed to be platform-independent and to be able to support a wide range of applications. The OpenDocument Format specification defines three document types:* Text documents* Spreadsheets* PresentationsEach document type has a corresponding XML schema. The schemas are designed to be extended, allowing application-specific features to be added.ODF documents can be encrypted and signed using the XML Encryption and XML Signature standards. The OpenDocument Format is supported by a number of office applications, including Apache OpenOffice, LibreOffice, IBM Lotus Symphony and Microsoft Office.
Read More