将带有图片和图表的 XLS 文件转换为 PDF

Contents
[ ]

该过程可在内存中进行,不依赖临时或中间 XML 文件。这意味着大型 Excel 文件(例如含有图片、图表和其他绘图对象的文件)可快速高效地转换。

// 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);

相关文章