转换Excel为PDF时呈现Office加载项
Contents
[
Hide
]
可能的使用场景
之前,当将Excel文件保存为PDF格式时,Aspose.Cells无法呈现Office加载项。现在Aspose.Cells可以很好地呈现它。您不需要使用任何特殊的方法或属性来在输出PDF中呈现Office加载项。只需将您的Excel文件保存为PDF格式,它将呈现Office加载项。
在将Excel转换为PDF时呈现Office加载项
以下示例代码保存包含Office加载项的样本Excel文件。请查看由之前版本即17.11生成的输出PDF和由新版本即17.12及以后版本生成的输出PDF。之前版本的输出PDF为空白的,而新版本的输出PDF显示了Office加载项。
示例代码
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 | |
//Load the sample Excel file containing Office Add-Ins | |
Workbook wb = new Workbook("sampleRenderOfficeAdd-Ins.xlsx"); | |
//Save it to Pdf format | |
wb.save("output-" + CellsHelper.getVersion() + ".pdf"); |