画像とグラフを含むXLSファイルをPDFに変換
Contents
[
Hide
]
Aspose.Cellsは、画像とグラフを含むXLSファイルをPDF文書に変換することをサポートしています。Aspose.Cells for JavaはスプレッドシートをPDFに変換する際に独立して動作します:Aspose.PDF APIは変換に必要ありません。
このプロセスは一時的な中間XMLファイルに依存しないため、メモリ上で実行できます。つまり、画像やグラフなどの描画オブジェクトを含む大きなExcelファイルも迅速かつ効率的に変換することができます。
スプレッドシートに数式が含まれている場合は、PDFへのレンダリング直前にWorkbook.calculateFormulaメソッドを呼び出すのが最適です。これにより、数式に依存する値が再計算され、正しい値がPDFにレンダリングされます。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(ConvertXLSFileToPDF.class); | |
//Create a new Workbook | |
Workbook book = new Workbook(dataDir + "SampleInput.xlsx"); | |
//Save the excel file to PDF format | |
book.save(dataDir + "output.pdf", SaveFormat.PDF); |