Error when Converting PPTX to PDF


I have a simple code where in I will open a pptx file and convert it to pdf.

Below is the code snippet.

if (pdftron.PDF.Convert.RequiresPrinter(inputPath))

if (pdftron.PDF.Convert.Printer.IsInstalled(“PDFTron PDFNet”))
pdftron.PDF.Convert.Printer.SetPrinterName(“PDFTron PDFNet”);
using (PDFDoc doc = new PDFDoc())

pdftron.PDF.Convert.ToPdf(doc, inputPath);
doc.Save(destinationPath, SDFDoc.SaveOptions.e_linearized);
outputPath = destinationPath;

And it returns an exception

Message: An error occurred while converting the file.
Detailed error:
Error opening the presentation (presentation maybe invalid, corrupted, or password protected).
COM Interop Error:
Code: 0
ARG Index: 0
File: “PowerPoint.cpp”:459
Start check system account.
Session ID is: 0.
Done checking system account.
Creating a PowerPoint application instance.
PowerPoint application instance created.
Application.AutomationSecurity ID obtained.
Application.AutomationSecurity value set to 3.
Application.DisplayAlerts ID obtained.
Application.Version ID obtained.
Application version: 16.
Application.Build ID obtained.
Application build: 4266.
Application.Presentations ID obtained.
Opening presentation “D:\simple_api\AssetsAuthModule\Assets\d9fd61d62c4640788470c6382fdc4668.pptx”.
Presentations.Open ID obtained.

The file is not password proctected and is valid.

Please let me know. Thank You

Hello, are you experiencing this issue with every pptx file, or just a particular one? Additionally, are you experiencing this issue when only converting power point files?

If its just one file you are getting this issue with, could you please email and provide us with the file there? We can then investigate further.

Hi This is for all pptx files and all xlsx files. Thank

Is MS PowerPoint on this machine licensed or in demo/trial mode?

Please also make sure the Print Spool service is running.

You can also try this project to help diagnose issues.

Just modify the code to convert Excel or Powerpoint file.