Save Java PDF in Excel

 

I introduced how to convert Excel to PDF in Java before, but what if you want to save PDF in Excel? This time, let's show it through Spire.PDF for Java.

Preparation

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

f:id:lendoris:20201223153847p:plain

2. Start the IDE, create a new project, and then add the appropriate Spire.PDF.jar for the installed files to your references.

 

f:id:lendoris:20201223153900p:plain

Original file

f:id:lendoris:20201223153936p:plain

import com.spire.pdf.FileFormat;
import com.spire.pdf.PdfDocument;

public class ToXLS {
    public static void main(String[] args) {
        //Create a PdfDocument.
        PdfDocument pdf = new PdfDocument();
        //Load the PDF file.
        pdf.loadFromFile("C:\\Users\\Test1\\Desktop\\Sample.pdf");
        //Save in Excel.
        pdf.saveToFile("output/ToXLS.xlsx", FileFormat.XLSX);
    }
}

Completion example

f:id:lendoris:20201223153959p:plain

 

 

 

 

 

 

 

 

 

 

 

 

Recommended Posts

Save Java PDF in Excel
Importing Excel data in Java 2
Java turns Excel into PDF
Save Java HTML as PDF
Import Excel data in Java
Importing Excel data in Java 3
I created a PDF in Java.
Java draws shapes in PDF documents
Partization in Java
Changes in Java 11
Rock-paper-scissors in Java
Java creates a pie chart in Excel
Delete blank rows / columns in Java Excel
Program PDF headers and footers in Java
Pi in Java
FizzBuzz in Java
Create barcodes and QR codes in Java PDF
Read a string in a PDF file with Java
Text extraction in Java from PDF with pdfbox-2.0.8
Capture and save from selenium installation in Java
Add, read, and delete Excel comments in Java
Compare PDF output in Java for snapshot testing
[java] sort in list
Read JSON in Java
Interpreter implementation in Java
[Java] Convert PDF version
Rock-paper-scissors app in Java
Constraint programming in Java
Put java8 in centos7
NVL-ish guy in Java
Combine arrays in Java
"Hello World" in Java
Callable Interface in Java
Java compressed PDF document
Comments in Java source
Azure functions in java
Format XML in Java
Simple htmlspecialchars in Java
Print Java Excel Worksheet
Boyer-Moore implementation in Java
Hello World in Java
Use OpenCV in Java
webApi memorandum in java
Type determination in Java
[Java] PDF viewing settings
Ping commands in Java
Various threads in java
Heapsort implementation (in java)
Zabbix API in Java
ASCII art in Java
Compare Lists in Java
POST JSON in Java
Express failure in Java
Create JSON in Java
Date manipulation in Java 8
What's new in Java 8
Use PreparedStatement in Java
What's new in Java 9,10,11
Parallel execution in Java
Initializing HashMap in Java
Read binary files in Java 1