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

Ohad cohen 1 Reputation point
2021-03-11T12:36:24.067+00:00

Hi, When using pptx with embedded object as an image![76724-image.png][1] [1]: /api/attachments/76724-image.png?platform=QnA 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 Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,517 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. David 146 Reputation points
    2021-04-15T08:03:27.133+00:00

    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);
            }
        }
    }
    
    0 comments No comments