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.BitmapData, Bool ean)' to access security critical method 'System.Runtime.InteropServices.Marshal .Copy(IntPtr, Byte[], Int32, Int32)' failed