C# 正在尝试使用Aspose.PDF将XPS转换为PDF文档
我正在尝试将XPS文档转换为PDF文档。我能够转换一些简单的XPS文档,但不能转换较重的文档。我已经获得了Aspose的免费开发者许可证。这是我处理此转换的代码片段C# 正在尝试使用Aspose.PDF将XPS转换为PDF文档,c#,.net,aspose,pdf-conversion,aspose.pdf,C#,.net,Aspose,Pdf Conversion,Aspose.pdf,我正在尝试将XPS文档转换为PDF文档。我能够转换一些简单的XPS文档,但不能转换较重的文档。我已经获得了Aspose的免费开发者许可证。这是我处理此转换的代码片段 Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License(); pdfLicense.SetLicense("Aspose.Total.lic"); Aspose.Pdf.XpsLoadOptions options = new XpsLoadOptions(); 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,字节[],Int32,
Int32)“”失败
我收到此错误--未处理的异常:System.MethodAccessException:安全传输nt方法“Aspose.Pal.PalBitmap.ParseRgb(System.Drawing.Imaging.BitmapData,Bool-ean)”尝试访问安全关键方法“System.Runtime.InteropServices.Marshal.Copy(IntPtr,字节[],Int32,Int32)'失败。请编辑您的问题并在此处添加错误详细信息,而不是在注释中写入。我收到了此错误--未处理的异常:System.MethodAccessException:尝试使用安全transpare nt方法'Aspose.Pal.PalBitmap.ParseRgb(System.Drawing.Imaging.BitmapData,Bool-ean)“访问安全关键方法”System.Runtime.InteropServices.Marshall.Copy(IntPtr,字节[],Int32,Int32)失败。请编辑您的问题并在其中添加错误详细信息,而不是在注释中写入。