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

AWS Commands

TOP 10 INTERIOR DESIGN + HOME DECOR TRENDS FOR 2022

Reflection 04: Problems

SpringBoot: Automatic assembly Part 1

Coding == Programming?

การทำเครื่องวัดฝุ่น PM2.5

Automatic Schema Synchronization in NDB Cluster 8.0: Performance Schema Tables

Quick pro tips for Bitbucket pipeline

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

Diving into Java (with strong JavaScript and Python background) Part 3(Arrays, L, and Objects)

Java Tutorial. Getters and Setters

Object-Oriented Programming

CS371p Spring 2022: Sarunas Budreckis — Entry #5