Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Fri Mar 24, 2017 11:52 am

Dear Team,

I am trying to use the belowsaid code to generate a PPT. Powerpoint when I launch is saying the file is corrupting and is attempting to repair it. All I need is to have a slide in the PPT with a caption and insert an image below. Can you help me where I am going wrong.

The desktop PPT is 2016

Presentation pptDocument = new Presentation();
ISlide defaultSlide = pptDocument.Slides[0];

IAutoShape shape = defaultSlide.Shapes.AppendShape(ShapeType.Rectangle, new RectangleF());
shape.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.None;

shape.AppendTextFrame("Hello World");
shape.TextFrame.Paragraphs[0].TextRanges[0].LatinFont = new TextFont("Arial Black");
shape.TextFrame.Paragraphs[0].TextRanges[0].Fill.FillType = FillFormatType.Solid;
shape.TextFrame.Paragraphs[0].TextRanges[0].Fill.SolidColor.Color = Color.Black;

pptDocument.SaveToFile(strEffortPptPath, FileFormat.Pptx2010);

pptDocument = null;

lavanyadeepak
 
Posts: 1
Joined: Thu Feb 23, 2017 9:25 am

Mon Mar 27, 2017 3:03 am

Dear lavanyadeepak,

Thanks for your inquiry.
I have tested the code you provided with Spire.Presentation Pack Hotfix Version:2.7.51. And the result file(on attachment ) can be opened successfully using MS PPT 2016, please try to use this version.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Mar 28, 2017 7:50 am

Dear lavanyadeepak,

Did you test the hotfix I mentioned ? Did it solve the issue ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Presentation