0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Java ExcelをPDFに変換

Last updated at Posted at 2021-04-28

今日はSpire.XLS for Javaという無料のライブラリを使ってExcelをPDFに変換する方法を紹介していきます。さあ、行きましょう!

下準備

1.E-iceblueの公式サイトからFree Spire. XLS for Java無料版をダウンロードしてください。

f:id:lendoris:20210428154326p:plain

2.IDEを起動して新規プロジェクトを作成してから、インストールされたファイルにあった相応しいSpire. XLS.jarを参照に追加してください。

<p><strong> <img src="https://cdn-ak.f.st-hatena.com/images/fotolife/l/lendoris/20210428/20210428154341.png" alt="f:id:lendoris:20210428154341p:plain" title="" class="hatena-fotolife" itemprop="image" /></strong></p>
<p><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/l/lendoris/20210428/20210428154436.png" alt="f:id:lendoris:20210428154436p:plain" title="" class="hatena-fotolife" itemprop="image" /></p>
```JAVA

import com.spire.xls.*;

public class ExcelToPDF {
    public static void main(String[] args) {
       
 //Excelファイルをロードします。
        Workbook wb = new Workbook();
        wb.loadFromFile("test.xlsx");

        //PDFで保存します。
        wb.saveToFile("ToPDF.pdf",FileFormat.PDF);
    }
}

実行結果

f:id:lendoris:20210428154445p:plain

 

0
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?