我正在尝试将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数据, Bool ean)'访问安全关键方法 ' System.Runtime.InteropServices.Marshal .Copy(IntPtr,Byte [],Int32, INT32)'失败