I get UnsupportedFormatException while converting from PPTX to PDF

Hello.


I get the following UnsupportedFormatException while converting from PPTX to PDF:
"The file is ZIP archive. It can be Microsoft PowerPoint 2007 PPTX presentation."

My code is:

Aspose.Slides.Presentation slides = new Aspose.Slides.Presentation(@“D:\Input\Example.pptx”);
using (FileStream fs = new FileStream(@“D:\Output\PDFfromPowerPoint.pdf”, FileMode.Create))
{
slides.Save(fs, Aspose.Slides.Export.SaveFormat.Pdf);
}

My Example.pptx file is attached.

Thanks,
Alex.

Hi Alex,


Thanks for inquiring Aspose.Slides.

I have worked with the presentation file shared by you using Aspose.Slides for .NET 7.1.0 and have not been able to reproduce the issue specified. Actually, you need to use PresentationEx class instead of Presentation class to load PPTX presentations. Please use the following sample code for your convenience.


PresentationEx origPres = new PresentationEx(path + “TestSmartArt.pptx”);
origPres.Save(path + “TestSmartArt_2.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);

Many Thanks,

Hello.


With the PresentationEx class it works now,
but the text in the result PDF file should be RTL-formatted (Hebrew language).
Please, send me a code that turns my text to RTL-formatted.

Thanks,
Alex.

Hi Alex,


There are no settings to set the RTL for the text before generating PDF. Can you please share what issue you are having on your end so that I may add that for further investigation in our issue tracking system.

Many Thanks,

Hello.


First of all, you can compare the original (PPTX) and the target (PDF) files and figure out the differences in the alignment (RTL in the PPTX and LTR in the PDF).
I have tried to make RTL manually by the following code, but with no success:

PresentationEx slides = new PresentationEx(@“D:\Input\Example.pptx”);
foreach (var tf in PresentationScanner.GetAllTextFrames(slides, true))
{
foreach (Aspose.Slides.Pptx.ParagraphEx para in tf.Paragraphs)
{
para.ParagraphFormat.RightToLeft = Aspose.Slides.Pptx.NullableBool.True;
}
}
using (FileStream fs = new FileStream(@“D:\Output\PDFfromPowerPoint.pdf”, FileMode.Create))
{
slides.Save(fs, Aspose.Slides.Export.SaveFormat.Pdf);
}

Thanks,
Alex.

Hi Alex,


Thanks for sharing the further feedback from you. I have observed the generated PDF and compared that with source presentation. I have observed issues on Slide 3, Slide 4 and Slide 5. I have encircled the issues identified in the attachment just for a reason to be on same page with you before adding them to our issue tracking system for resolution. Can you please confirm the issues or am I missing some thing here. Please share your feedback so that I may proceed with adding issue in our issue tracking system.

Many Thanks,

Hello.


You are right: the RTL format problem appears exactly on Slide 3, Slide 4 and Slide 5.

Thanks,
Alex.

Hi Alex,


Thanks for your feedback. I have generated and issue with ID SLIDESNET-34018 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

Hello.


Do you have a schedule for solving the SLIDESNET-34018 issue ?

Thanks,
Alex.

Hi Alex,


I have discussed the issue status with our development team and like to share that issue has been scheduled for investigation during Week 15/2013. I will be able to share the further feedback with you as soon as the investigation will be completed by our development team and feedback will be shared.

Many Thanks,