Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Last try ;-) You could use Interop, open the file and afterwards save it as pdf.</p> <p>For this little example to work you need to reference the Microsoft.Office.Interop.PowerPoint assembly and the Microsoft.Office.Core namespace (found in the "Microsoft Office 14.0 Object Library" assembly which is located under the COM assemblies).</p> <p>Little Example:</p> <pre><code>/// &lt;summary&gt; /// Converts the specified source file and saves it as pdf with the /// specified destination filename. /// &lt;/summary&gt; /// &lt;param name="sourceFilename"&gt;The filename of the file to be converted into a pdf.&lt;/param&gt; /// &lt;param name="destinationFilename"&gt;The filename of the pdf.&lt;/param&gt; /// &lt;exception cref="System.IO.FileNotFoundException"&gt;Is thrown if the specified source file does not exist.&lt;/exception&gt; /// &lt;exception cref="System.Exception"&gt;Is thrown if something went wrong during the convertation process.&lt;/exception&gt; public static void SaveAsPDF(string sourceFilename, string destinationFilename) { if (!File.Exists(sourceFilename)) { throw new FileNotFoundException(string.Format("The specified file {0} does not exist.", sourceFilename), sourceFilename); } try { Microsoft.Office.Interop.PowerPoint.Application app = new Microsoft.Office.Interop.PowerPoint.Application(); app.Presentations.Open(sourceFilename).SaveAs(destinationFilename, Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType.ppSaveAsPDF); app.Quit(); } catch (Exception e) { throw new Exception(string.Format("Unable to convert {0} to {1}", sourceFilename, destinationFilename), e); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload