将 Excel 转换为 PDF 时呈现 Office 加载项
Contents
[
Hide
]
可能的使用场景
早些时候,当 Excel 文件保存为 PDF 格式时,Aspose.Cells 无法呈现 Office 加载项。现在 Aspose.Cells 可以正常显示。您不需要使用任何特殊方法或属性在输出 PDF 中呈现 Office 加载项。只需将 Excel 文件保存为 PDF 格式,它就会呈现 Office 加载项。
将 Excel 转换为 PDF 时呈现 Office 加载项
下面的示例代码保存了示例 Excel 文件其中包含 Office 加载项。请参阅使用先前版本即 17.11 生成的输出 PDF和输出 PDF 使用较新版本生成,即 17.12 及更高版本.先前版本输出 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"); |