Hi Team,
Below is the code snippet used to create a ppt file and saved it into stream.
Presentation m_show = new Presentation();
ILayoutSlide layout = m_show.LayoutSlides.GetByType(SlideLayoutType.Blank);
m_show.Slides.Remove(m_show.Slides[0]);
ISlide slide = m_show.Slides.AddEmptySlide(layout);
double[] width = {1000.0};
double[] height = {10.0};
ITable pptTable = slide.Shapes.AddTable(100f,100f,width,height);
ICell pptCell = pptTable[0,0];
string tempString = "some text";
ITextFrame frame = pptCell.TextFrame;
Aspose.Slides.Paragraph graph = new Aspose.Slides.Paragraph();
frame.Paragraphs.Add(graph);
Portion portion = new Portion(tempString);
portion.PortionFormat.FontHeight = (short)12;
FontData fontData = new FontData("Arial");
portion.PortionFormat.LatinFont = fontData;
graph.Portions.Add(portion);
MemoryStream stream = new MemoryStream();
m_show.Save(stream, Aspose.Slides.Export.SaveFormat.Ppt);
Now while trying to get the presentation back from the stream, then receiving error like " Unable to de-serialize input stream "
try
{
Presentation source = null;
//Deserialize presentation from a stream
source = new Presentation(stream);
}
catch(Exception ex)
{
throw;
}
Can you please tell us why presentation class is not able to deserialize the input stream though the stream contains valid content.Also kindly let us know if there is any other way to achieve the same.
Thanks,
Divya