使用 Syncfusion 将 .pptx 文件转换为 PDF 时缺少程序集错误

Missing assembly error when converting .pptx file to PDF using Syncfusion

我有以下用于将 pptx 转换为 pdf 的代码:

IPresentation presentation = Presentation.Open(filePath);
presentation.ChartToImageConverter = new ChartToImageConverter();
pdfDocument = PresentationToPdfConverter.Convert(presentation);
presentation.Close();

然而,当代码命中该行时:

presentation.ChartToImageConverter = new ChartToImageConverter();

出现以下错误:

Could not load file or assembly 'Syncfusion.Compression.Base, Version=16.3460.0.29, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'

我已经验证了我的 web.config 和参考资料中的 dll,这里的 dll 版本正确。

然而,当我删除该行时:

presentation.ChartToImageConverter = new ChartToImageConverter();

它工作正常。

知道我在这里遗漏了什么吗?

谢谢

我怀疑您正在使用不同版本的 Syncfusion 程序集(Compression.Base 和 OfficeChartToImageConverter.Base)将 pptx 文档转换为 PDF。您能否交叉检查程序集(Compression.Base 和 OfficeChartToImageConverter.Base)是否具有相同版本。如果您仍然无法解决此问题,请告诉我,我将分享一个工作示例供您参考。
注意:我为 Syncfusion

工作