title: How do I convert a PowerPoint file to PDF using Aspose 6.4?
body: <p>I am using <code>aspose.slides.dll</code> v6.4.0 to convert <code>.pptx</code> files to <code>.pdf</code>.</p>
  <p>My Code:</p>
  <pre><code>public static MemoryStream pptx2Pdf(byte[] FileRead)
  {
      MemoryStream ResultStream = new MemoryStream();
      Aspose.Slides.Pptx.PresentationEx pres = new Aspose.Slides.Pptx.PresentationEx(new MemoryStream(FileRead));
      pres.Save(ResultStream, Aspose.Slides.Export.SaveFormat.Pdf);
      return ResultStream;
  }
  </code></pre>
  <p>But when the method is called, the following exception is shown and file is not converted:</p>
  <blockquote>
  <p>Attempt by security transparent method 'ns3.Class115.smethod_6(System.Drawing.Imaging.BitmapData, Boolean)' to access security critical method 'System.Runtime.InteropServices.Marshal.Copy(IntPtr, Byte[], Int32, Int32)' failed.</p>
  <p>Assembly 'Aspose.Slides, Version=6.4.0.0, Culture=neutral, PublicKeyToken=null' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model.  Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.</p>
  </blockquote>
  <p>I tried to search for details about this exception, but could find nothing relevant to it. How can I resolve this issue?</p>