Format of Data in Slides Is Not Supported when Converting PDF to PPT in C#

Capture.PNG (13.1 KB)

@MRagab,
Thank you for contacting support.

In order to investigate the case and help you, we need more detailed information on this issue. Please share the following files and information:

  • code example that reproduces the problem you encountered
  • input and output files (you can compress the files into a zip archive and upload it here)
  • OS version on which the code was executed
  • .NET target platform in your app
  • Aspose.Slides version you used

Convert Code:

string pdfFileName = folderPath + "Single page Example.pdf";
string inputDocxPath = Path.Combine("wwwroot", "Uploads", "ApprovedProjects.pdf");
string outputPptxPath = Path.Combine("wwwroot", "Uploads", "PDFToPPT_out");

// Map virtual paths to physical paths
string dataDir = Path.Combine(_env.ContentRootPath, inputDocxPath);
string physicalOutputPptxPath = Path.Combine(_env.ContentRootPath, outputPptxPath);

// ExStart:PDFToPPT
// The path to the documents directory.
// Load PDF document
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(dataDir);
// Instantiate PptxSaveOptions instance
Aspose.Pdf.PptxSaveOptions pptx_save = new Aspose.Pdf.PptxSaveOptions();
// Save the output in PPTX format
pptx_save.OptimizeTextBoxes = true;

doc.Save(physicalOutputPptxPath, pptx_save);

.NET target platform : 3.1 .
OS version : Windows 10 Home N On Visual V 22
Aspose.Slides version: 24.3.0
and files
ConvertToPPtFile.zip (1.1 MB)

@MRagab,
Thank you for the details, we greatly appreciate it. You are using Aspose.PDF, so I’ve moved this thread to Aspose.PDF forum. My colleagues will assist you shortly.

@MRagab

Please check the attached output file that we obtained using 24.3 version of the API in our environment with below code snippet.

using (Aspose.Pdf.Document document = new Aspose.Pdf.Document(dataDir + "ApprovedProjects (1).pdf"))
{
    Aspose.Pdf.PptxSaveOptions pptxSave = new Aspose.Pdf.PptxSaveOptions();
    pptxSave.SlidesAsImages = false;
    //pptxSave.OptimizeTextBoxes = true;
    pptxSave.TryMergeAdjacentSameBackgroundImages = false;
    //pptxSave.ImageResolution = 300; //192//300 // All three values are producing output with same file size and image quality
    document.Save(dataDir  + "output24.3.pptx", pptxSave);
}

output24.3.zip (31.6 KB)

Can you please check if you find any issues in it?