Convert Java Powerpoint to XPS

Today I will show you how to convert Powerpoint to XPS in Java. This time, you need a library called Spire.Presentation for Java. It is free and can be used without downloading Microsoft Office software.

Let's go

Preparation

1. From the official website of E-iceblue Free Spire. Presentation for Download the free version of Java .

2. Launch the IDE to create a new project, then add the appropriate Spire. Presentation.jar to the reference that was in the installed file.

Original file

 

f:id:lendoris:20201223152051p:plain

```java import com.spire.presentation.*;

public class PPTtoXPS { public static void main(String[] args) throws Exception{

//Create a presentation object.
Presentation ppt = new Presentation();

//Load the file.
ppt.loadFromFile("Sample.pptx");

//Save with XPS.
ppt.saveToFile("toXPS.xps", FileFormat.XPS);

ppt.dispose();

}

}


 <h4> Completion example </h4>
<p><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/l/lendoris/20201223/20201223152106.png " alt="f:id:lendoris:20201223152106p:plain" title="" class="hatena-fotolife" itemprop="image" /></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>


Recommended Posts

Convert Java Powerpoint to XPS
How to convert Java radix
[Java] Convert ArrayList to array
Java adds SmartArt graphics to PowerPoint
[Java] Convert 1-to-N List to Map
[Android] Convert Android Java code to Kotlin
[Java] Convert array to ArrayList * Caution
Add / remove watermark to Java PowerPoint
Convert all Android apps (Java) to Kotlin
Convert from java UTC time to JST time
[Java] Convert Object type null to String type
Convert SVG files to PNG files in Java
[Java] Introduction to Java
Introduction to java
[Java] Convert DB code to code value using enum
How to convert a solidity contract to a Java contract class
Java adds a text box to PowerPoint slides
Convert Java nested beans to aaa.bbb [0] .ccc format
[Java] Convert PDF version
Changes from Java 8 to Java 11
Sum from Java_1 to 100
[Java] Connect to MySQL
Kotlin's improvements to Java
From Java to Ruby !!
Introduction to java command
Launch Docker from Java to convert Office documents to PDF
<java> Read Zip file and convert directly to string
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 3
Convert Java enum enums and JSON to and from Jackson
Sample code to convert List to List <String> in Java Stream
[Java] Convert character strings to uppercase / lowercase (AOJ⑨-swap uppercase and lowercase)
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 2
Java applications convert Word (DOC / DOCX) documents to PDF
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 1
How to convert A to a and a to A using AND and OR in Java
How to convert a file to a byte array in Java
[Java] Convert JSON to Java and Java to JSON-How to use GSON and Jackson-
[Java] How to use Map
How to lower java version
Migration from Cobol to JAVA
Java adds table to PDF
How to uninstall Java 8 (Mac)
[Java] I want to convert a byte array to a hexadecimal number
Java to play with Function
Java --How to make JTable
I want to convert characters ...
How to use java Optional
Convert String type to Timestamp type
New features from Java7 to Java8
How to minimize Java images
Convert a Java byte array to a string in hexadecimal notation
Convert to Ruby Leet string
How to write java comments
Create hyperlinks in Java PowerPoint
Convert Serializable Object to byte []
How to use java class
[Java] How to convert a character string from String type to byte type
[Java] How to use Optional ②
Connect from Java to PostgreSQL
[Java] How to use removeAll ()
[Java] How to display Wingdings