Hello,
when I try to save a PresentationEx to a MemoryStream and using the buffer bytes to save it to a file, PowerPoint shows a repair message on opening the pptx. If I save the PresentationEx directly to a file, there is no such message. (I’m using latest version of Aspose.Slides for .NET)
Here a very simple example:
class Program
{
static void Main(string[] args)
{
var pptx = new PresentationEx();
var idx = pptx.Slides[0].Shapes.AddAutoShape(ShapeTypeEx.Rectangle, 0, 0, 200, 250);
(pptx.Slides[0].Shapes[idx] as AutoShapeEx).TextFrame.Text = “Test”;<span style="color:blue;">byte</span>[] buffer; <span style="color:blue;">using</span> (<span style="color:blue;">var</span> ms = <span style="color:blue;">new</span> <span style="color:#2b91af;">MemoryStream</span>()) { pptx.Save(ms, <span style="color:#2b91af;">SaveFormat</span>.Pptx); buffer = ms.GetBuffer(); } <span style="color:blue;">var</span> id = <span style="color:#2b91af;">Guid</span>.NewGuid().ToString(); <span style="color:green;">// save using bytes from MemoryStream</span> <span style="color:#2b91af;">File</span>.WriteAllBytes(<span style="color:#2b91af;">Path</span>.Combine(<span style="color:#2b91af;">Environment</span>.GetFolderPath(<span style="color:#2b91af;">Environment</span>.<span style="color:#2b91af;">SpecialFolder</span>.Desktop), <span style="color:#a31515;">"MemoryStream_"</span> + id + <span style="color:#a31515;">".pptx"</span>), buffer); <span style="color:green;">// save directly to file</span> pptx.Save(<span style="color:#2b91af;">Path</span>.Combine(<span style="color:#2b91af;">Environment</span>.GetFolderPath(<span style="color:#2b91af;">Environment</span>.<span style="color:#2b91af;">SpecialFolder</span>.Desktop), <span style="color:#a31515;">"Direct_"</span> + id + <span style="color:#a31515;">".pptx"</span>), <span style="color:#2b91af;">SaveFormat</span>.Pptx); } }</pre></div>