1

我正在尝试将 XPS 文档转换为 PDF 文档。我可以转换一些简单的 XPS 文档,但不能转换繁重的文档。我已经获得了 Aspose 的免费开发者许可证。这是我处理此转换的代码片段

Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();
pdfLicense.SetLicense("Aspose.Total.lic");

Aspose.Pdf.XpsLoadOptions options = new XpsLoadOptions();
Aspose.Pdf.Document document = new Aspose.Pdf.Document(filepath, options);         
string newfullpath = Path.GetDirectoryName(filepath) + "\\" + Path.GetFileNameWithoutExtension(filepath) + ".pdf";       

document.Save(newfullpath);

错误

未处理的异常:System.MethodAccessException:尝试通过安全透明方法“Aspose.Pal.PalBitmap.ParseRgb(System.Drawing.Imaging.Bitmap‌​Data, Bool ean)”访问安全关键方法“System.Runtime.InteropServices.Marshal”。复制(IntPtr,字节 [],Int32,Int32)' 失败

4

0 回答 0