Aspose pdf to pptx not working, giving repair error when opening pptx file

We are using Aspose.PDF to transform PDF to PPTX, and everything has been working fine on .net core 3.1.
Now upgraded to core 6, the pptx file gives a repair error when we try to open it, and the content of the file does not matter. Right now we are testing with

test
as content, and the pptx file still gives the same error.

Is there something we need to do after the upgrade to core 6?

We are using aspose.pdf v. 22.10.0

@bohoirup

Would you please share a sample PDF document for our reference so that we can test the scenario in our environment and address it accordingly.

@asad.ali, all I do is this:

                Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document();
            Aspose.Pdf.Page page = pdfDocument.Pages.Add();
            Aspose.Pdf.HtmlFragment htmlFragment = new Aspose.Pdf.HtmlFragment("<h1>HTML String</h1>");
            page.Paragraphs.Add(htmlFragment);
            Aspose.Pdf.PptxSaveOptions pptx_savetest = new Aspose.Pdf.PptxSaveOptions();
            pdfDocument.Save(OutputPath + "PDFToPPT_out.pptx", pptx_savetest);

@bohoirup

We tested using 22.10 version of the API and this code snippet threw an exception under .NET 6 framework. Therefore, an issue is logged as PDFNET-52903 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi @asad.ali

Is there anyway around this at this point? I have a running system using .net framework, which is no offline, and it is not possible to rollback to Core 3.1 at this point.

So any kind of workaround would be much appreciated

Best regards
Bo

@bohoirup

We are afraid that we cannot offer any workaround at the moment as the ticket is not fully yet investigated. We need to determine first why this is happening. Your concerns have been recorded as well and we will consider them during investigation. We will let you know as soon as we have some update. Please be patient and spare us some time.

We apologize for the inconvenience.

@asad.ali

Hi, any updates on this?

Hard to keep finding excuses for this not working and no idea of when it will be fixed

Best regards

@bohoirup

Your concerns have already be taken into account and we are currently trying to investigate the reasons behind this issue. We will surely let you know as soon as our investigation is complete and we have some updates about ticket resolution. Please spare us some time.

We are sorry for the inconvenience.

@bohoirup

Please use the following code snippet
First save the new PDF file and then convert it to PPTX

Aspose.Pdf.Document pdf = new Aspose.Pdf.Document();
Aspose.Pdf.Page page1 = pdf.Pages.Add();
Aspose.Pdf.HtmlFragment htmlFragment = new Aspose.Pdf.HtmlFragment("<h1>HTML String</h1>");
/*
    You can set system font for htmlFragment like this
htmlFragment.TextState = new TextState();
htmlFragment.TextState.Font = FontRepository.FindFont("Courier New");
*/

page1.Paragraphs.Add(htmlFragment);
Aspose.Pdf.PptxSaveOptions pptx_savetest = new Aspose.Pdf.PptxSaveOptions();

using (MemoryStream ms = new MemoryStream())
{
    pdf.Save(ms);
    Document pdf2 = new Document(ms);
    pdf2.Save("..\\..\\..\\PDFToPPT_out.pptx", pptx_savetest);
}

@asad.ali

This gives me the exact same error as before when opening the PPTX file?

Do i need to upgrade to latest version of aspose.pdf?

@bohoirup

Please use 22.12 version of the API in order to test using the suggested code snippet and let us know if you still face any issues.

Still get the same error and now I also get a trial license error?

Do I need a new key or?

best regards

@bohoirup

We are sorry for the trouble. Can you kindly share a sample console application for our reference which is able to reproduce the same issue so that we can test the scenario in our environment and address it accordingly.

I am just using the exact code you sent me and have upgraded to 22.12, so you can just past this code into a console app

                Aspose.Pdf.Document testPdf = new Aspose.Pdf.Document();
            Aspose.Pdf.Page page1 = testPdf.Pages.Add();
            Aspose.Pdf.HtmlFragment htmlFragment = new Aspose.Pdf.HtmlFragment("<h1>HTML String</h1>");
            /*
                You can set system font for htmlFragment like this
            htmlFragment.TextState = new TextState();
            htmlFragment.TextState.Font = FontRepository.FindFont("Courier New");
            */

            page1.Paragraphs.Add(htmlFragment);
            Aspose.Pdf.PptxSaveOptions pptx_savetest = new Aspose.Pdf.PptxSaveOptions();

            using (MemoryStream ms = new MemoryStream())
            {
                testPdf.Save(ms);
                Aspose.Pdf.Document pdf2 = new Aspose.Pdf.Document(ms);
                pdf2.Save(OutputPath + "PDFToPPT_out.pptx", pptx_savetest);
            }

@asad.ali The license is not an issue, I just pasted the code in before setting the licenses … so sorry about that, just forget it.

The issue is still the error int the PPTX file (needs repair on opening)

@bohoirup

We tested the case again in our environment and did not notice any issue in the generated output PPTX. Please find the attached file and open it at your end and share the screenshot with us in case it still shows any warning. PDFToPPT_out.zip (8.7 KB)

Please send me the console app you have made, because I am still getting the same error.

Using the exact code pasted above on version 22.12PDFToPPT_out.zip (7.7 KB)

image.png (3.1 KB)

@asad.ali don’t know if I need to tag you but now i have

@bohoirup

Please download the sample console application from this link.