Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 正在尝试使用Aspose.PDF将XPS转换为PDF文档_C#_.net_Aspose_Pdf Conversion_Aspose.pdf - Fatal编程技术网

C# 正在尝试使用Aspose.PDF将XPS转换为PDF文档

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.

我正在尝试将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,字节[],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)失败。请编辑您的问题并在其中添加错误详细信息,而不是在注释中写入。