We have an Web-Application that allows users to build their own PPT from a selection of others.
Then the users push the ‘generate’-Button to generate the selected files to a new presentation via clone-function it happens that the generated ppt-file have bugs like:
- text with parts bold and parts not bold which are inverted after generating (slide 2 and 3 in generated file)
- The Bold-Bug follows to displacements in enumeration (slide 6 in generated file)
- our customer reports some other bugs after generating slides like missing footer
The Original-test-File is: http://www.cyberpark.de/AUMA_Gruppe_Deutschland_korrekt.ppt
The generated ppt is: http://www.cyberpark.de/AUMA_Gruppe_Deutschland_Fehler.ppt
We use the clone-method to generate a new presentation from slides of different ppt files:
private void GetPresentationFile()
{
XmlDocument docConfig = this.GetConfigDoc();
Presentation presentation = new Presentation();
uint slideMaster = uint.MinValue;
SortedList masters = new SortedList();
XmlNodeList mediaNodes = docConfig.SelectNodes("/PPManagerConfig/media");
foreach(XmlNode mediaNode in mediaNodes)
{
Guid sourceVersionGroup = new Guid(mediaNode.Attributes[“versionGroup”].Value);
XmlNode slideNode = mediaNode.SelectSingleNode(“slide”);
uint sourceSlideId = uint.Parse(slideNode.Attributes[“id”].Value);
bool isMaster = Convert.ToBoolean(slideNode.Attributes[“containsMaster”].Value);
UploadLibrary2File fileSource = new UploadLibrary2File(sourceVersionGroup);
string pathSessiontempFolder = this.GetTempPath(Session.SessionID, true);
string tempPath = Path.Combine(pathSessiontempFolder, “file_”+fileSource.Id+"."+fileSource.Extension);
if(!File.Exists(tempPath))
{
FileStream fs = new FileStream(tempPath, FileMode.Create);
fileSource.GetFile(fs);
fs.Close();
fs = null;
}
fileSource = null;
Presentation presSource = null;
try{
presSource = new Presentation(tempPath);
}catch{
return;
}
Slide slideSource = presSource.GetSlideById(sourceSlideId);
Slide slideImported = presSource.CloneSlide(slideSource, presentation.Slides.LastSlidePosition, presentation, masters);
if(isMaster) slideMaster = slideImported.MasterId;
slideSource = null;
presSource = null;
slideNode = null;
}
masters = null;
mediaNodes = null;
if(slideMaster != uint.MinValue)
{
foreach(Slide slide in presentation.Slides)
{
slide.MasterId = slideMaster;
}
}
// presentation.DeleteUnusedMasters();
presentation.Slides.RemoveAt(0);
Response.Clear();
Response.ContentType = “application/vnd.ms-powerpoint”;
Response.AppendHeader(“Content-Disposition”, “attachment; filename=”+Session.SessionID+".ppt");
presentation.Write(Response.OutputStream);
}
This is causing us great problems because therefore the hole application is not fit for service for our customer
Any suggestions are welcome.