Thank you for your response, Please find the attached ppt, first and forth slide has animated GIF, when I tried to create a presentation by reading those slides. The presentation created successfully and if I tried to open it, MS ppt is not responding.
If I tried to create ppt only with forth slide it opens in MS ppt but the GIF image does not works.
if I tried to create ppt only with first slide it opens in MS ppt but the GIF image does not works.
if I tried to create a ppt with first and forth slide on it , the file is not responding. it only happens if I add the first as first and forth as second.
- Code: Select all
var userid = Request.QueryString["id"];
if (userid != null)
{
DataCommand command = new DataCommand("getActiveSlides");
command.Add("userid", userid);
DataSet ds = (DataSet)command.Execute(true);
DataTable dt = ds.Tables[0];
Presentation newP = new Presentation();
Presentation helper = new Presentation();
var pname = "";
foreach (DataRow dr in dt.Rows)
{
var presentationName = dr["presentationid"].ToString() + dr["type"].ToString();
Int32 slideIndex = Convert.ToInt32(dr["slideindex"].ToString());
Int32 orderNumber = Convert.ToInt32(dr["ordernumber"].ToString());
//if(pname != presentationName) {
helper.LoadFromFile(Server.MapPath("~/Uploads/" + presentationName)); //loading ppt file
pname = presentationName;
//}
ISlide orgSlide = helper.Slides[slideIndex]; // reading the slide
newP.Slides.Insert(orderNumber, orgSlide); // inserting in to new ppt
}
Byte[] Content = newP.GetBytes();
Response.ContentType = "application/octet-stream";
Response.AddHeader("content-disposition", "attachment; filename=presentation.ppt");
Response.BufferOutput = true;
Response.OutputStream.Write(Content, 0, Content.Length);
Response.End(); //downloading it
}
Login to view the files attached to this post.