转换Excel为PDF时呈现Office加载项
Contents
[
Hide
]
可能的使用场景
之前,当将Excel文件保存为PDF格式时,Aspose.Cells无法呈现Office加载项。现在Aspose.Cells可以很好地呈现它。您不需要使用任何特殊的方法或属性来在输出PDF中呈现Office加载项。只需将您的Excel文件保存为PDF格式,它将呈现Office加载项。
在将Excel转换为PDF时呈现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-.NET | |
//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"); |