Java/ Convert Excel to XPS

<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.xls.free</artifactId>
<version>3.9.1</version>
</dependency>
</dependencies>
  • Create a Workbook instance.
  • Load a sample Excel document using Workbook.loadFromFile() method.
  • Save the document to XPS file format using Workbook.saveToFile() method.
import com.spire.xls.*;

public class toXPS {
public static void main(String[] args) {
//Create a Workbook instance
Workbook workbook = new Workbook();

//Load an Excel document
workbook.loadFromFile("Data.xlsx");

//Convert Excel to XPS
workbook.saveToFile("ToXPS.xps", FileFormat.XPS);
}
}

--

--

--

Sharing Java Code

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Tutorial Fuzzy Logic Mamdani for Arduino

Tutorial Fuzzy Logic Mamdani for Arduino

When speed matters, use C

Stateful or Stateless widgets?

Learning C: The Select from Alternatives Template Part 2

Roles and Responsibilities in a microsevices world

Chronically Execute Processes in NiFi

3 Chrome Extensions to Give GitHub Superpowers

Butter Royale AI — Continued

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrew Wilson

Andrew Wilson

Sharing Java Code

More from Medium

Add Superscript and Subscript to PowerPoint Using Java

Java static can be…

How To: Create a Java Telegram Bot

Log4Shell in SQL ? JNDI exploit for Java H2 (CVE-2021–42392)