Using Aspose.Total for Java you can easily convert XPS to PPSM 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 PPSM.
Java API to Convert XPS to PPSM
- 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 PPSM format using
method and set
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 Ppsm format presentation.save("output.ppsm", SaveFormat.Ppsm);
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 PPSM File with Predefined View Type via Java
After converting XPS to PPSM, 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 Ppsm format presentation.save("output.ppsm", SaveFormat.Ppsm);
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 More
What is PPSM File Format
Macro-enabled Slide Show PPSM format is a file format that allows you to create presentations that contain macros. Macros are small programs that can automate tasks, and they can be used in presentations to automate tasks such as playing a video or animating a slide. The PPSM format is similar to the PPTX format, but it uses a different file extension (PPSM instead of PPTX). PPSM files can be opened in PowerPoint 2013 or later. When you create a presentation in the PPSM format, you can add macros to the slides. To add a macro to a slide, you first need to create a macro in PowerPoint. To do this, click the File tab, then click Options. In the PowerPoint Options dialog box, click Customize Ribbon. In the Customize Ribbon dialog box, click the Macros tab, then click New.In the Macro dialog box, enter a name for the macro, then click the Browse button. In the Browse dialog box, locate the PowerPoint file that contains the macro code, then click Open.In the Macro dialog box, click the Options button. In the Macro Options dialog box, select the Run Macro On Slide Show check box, then click OK.Now that the macro is created, you can add it to a slide. To do this, click the Insert tab, then click the Macro button. In the Macro dialog box, select the macro that you want to insert, then click Insert. The macro will now be added to the slide. To run the macro, click the Slide Show tab, then click From Beginning. The macro will now run automatically when the slide is displayed.Read More