question

Ohadcohen-5006 avatar image
0 Votes"
Ohadcohen-5006 asked ·

pptx to pdf bad conversion using Microsoft.Office.Interop.PowerPoint

Hi, When using pptx with embedded object as an image![76724-image.png][1] [1]: /answers/storage/attachments/76724-image.png the image cannot be converted to PDF using Microsoft.Office.Interop.PowerPoint.MSPowerPoint.Presentation.pptPresentation.SaveAs("test.pdf", MSPowerPoint.PpSaveAsFileType.ppSaveAsPDF, Microsoft.Office.Core.MsoTriState.msoCTrue); Is this bug known?

office-addins-dev
image.png (6.1 KiB)
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

David-9140 avatar image
0 Votes"
David-9140 answered ·

Hi, if you do not mind using a third-party library, you cloud try Spire.Presentation for .NET to do the conversion through the following code snippet.

 using Spire.Presentation;
    
 namespace PPTXtoPDF
 {
     class Program
     {
         static void Main(string[] args)
         {
             //create a Presnetation object
             Presentation presentation = new Presentation();
             //load powerpoint file 
             presentation.LoadFromFile("test.pptx");
             //save to pdf
             presentation.SaveToFile("ToPdf.pdf", FileFormat.PDF);
         }
     }
 }


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.