1

I am trying to convert XPS document to a PDF document.I am able to convert some simple XPS documents but not heavy ones. I have taken a free developer license for Aspose. This is a snippet from my code which is dealing with this conversion

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);

ERROR

Unhandled Exception: System.MethodAccessException: Attempt by security transpare nt method 'Aspose.Pal.PalBitmap.ParseRgb(System.Drawing.Imaging.Bitmap‌​Data, Bool ean)' to access security critical method 'System.Runtime.InteropServices.Marshal .Copy(IntPtr, Byte[], Int32, Int32)' failed

lokusking
  • 7,396
  • 13
  • 38
  • 57
  • I am getting this error ---Unhandled Exception: System.MethodAccessException: Attempt by security transpare nt method 'Aspose.Pal.PalBitmap.ParseRgb(System.Drawing.Imaging.BitmapData, Bool ean)' to access security critical method 'System.Runtime.InteropServices.Marshal .Copy(IntPtr, Byte[], Int32, Int32)' failed. – Harshit Agarwal Nov 29 '16 at 05:21
  • Edit your question and add the error detail there rather then writing in comment. – Mukesh Modhvadiya Nov 29 '16 at 06:00

0 Answers0