I created a simple demo (web) application to show the possibilities of Aspose.Slides to some sales people.
When I run the application locally, everything works fine.
When I run the application on a remote server (http://vintage.stage.vintage.be/pptgen/
) however, all layout and images that are in the original PPT (see http://vintage.stage.vintage.be/pptgen/vintage.ppt
) are lost for some reason.
This is the code I use:
System.IO.FileStream fis = new System.IO.FileStream(MapPath(".") + “\vintage.ppt”, System.IO.FileMode.Open, System.IO.FileAccess.Read);
Presentation pres = new Presentation(fis);
fis.Close();
Slides slides = pres.Slides;
for (int i=0; i<slides.Count; i++)
{
Placeholders pholders = slides[i].Placeholders;
for (int j=0; j<pholders.Count; j++)
{
TextHolder th = pholders[j] as TextHolder;
if (th != null)
{
if (th.Text == “TITLE”)
th.Paragraphs[0].Portions[0].Text = txtPresentationTitle.Text;
else if (th.Text == “SLIDETITLE”)
th.Paragraphs[0].Portions[0].Text = txtSlideTitle.Text;
else if (th.Text.IndexOf(“CONTENT”) != -1)
{
string [] strParagraphs = txtSlideCOntent.Text.Split((char)13);
int iRec = 0;
foreach(string s in strParagraphs)
{
th.Paragraphs[iRec].Portions[0].Text = s.Replace("\n","");
iRec++;
}
}
}
}
}
this.Response.ContentType = “application/vnd.ms-powerpoint”;
this.Response.AppendHeader(“Content-Disposition”, “attachment; filename=demoppt.pps”);
this.Response.Flush();
System.IO.Stream st = this.Response.OutputStream;
pres.Write(st);
this.Response.End();
Do you have any clue?