Free Support Forum - aspose.com

Problems after cloning slides

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.

Dear weyel,

Thank you for reporting these problems, I will soon be looking into them and report them after reproducing them.

Probably, many of them have already been resolved and will be available in next fix.

I have reproduced this bug and it will be fixed in couple of weeks.

There are two things in your code, which may cause errors sooner or later are the following.

You should always pass a new SortedList object and should not use the existing one. i.e

----------------------------------------------------

//modifications in your code

Slide slideImported = presSource.CloneSlide(slideSource, presentation.Slides.LastSlidePosition, presentation, new SortedList());

You should use Slide.ChangeMaster() method to change master of the normal slide i.e.

----------------------------------------------------

//modifications in your code

foreach(Slide slide in presentation.Slides)

{

slide.ChangeMaster(presentation.GetSlideById(slideMaster));

}

Dear msfaiz,

thank you for your information.

The modification in our source has been carried out and now we wait for the bugfix.

Can you give me a detail about 'couple of weeks' ;-)

thank you in advance

ingo

Generally, the estimated time for the fix is allocated to be 1-2 weeks but it could take longer than it, if the source of problem could not be found or there are already bugs pending for a fix or the fix of the bug depends on the fix of other bugs.

Dear msfaiz,

is there any new information about the bugfix for our customer available?
We need it as quick as possible ;-)

thank you in advance

ingo

The bug has not been fixed yet, but it is likely to be fixed by the end of next week. Thanks for your patience.

hi,

is there any news about the fix? We need it very urgend.

thank you in advance

ingo

Hello Ingo,

Sorry for delay. Please check attached hot fix.
The problem with bold fonts has been fixed.

Dear alcrus,

thank you for the fix which works for the font-bug fine. Unfortunately it seems that this fix produce a new bug:

If i clone the first slide in the demo ppt (see above) - the slide with the AUMA-Logo at the right top - the clone looses this logo if i open the generated ppt with PowerPoint 2007. With pp2000 the Logo appears fine.

Do you have any hint or fix for this?

Thank you in advance.

ingo

Dear weyel,

Please provide your source presentation, because the links provided by you are not working.

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

sorry. Now it works again…

Dear msfaiz,

is there any new information?

I have 2 more questions:

1. i have the same problems described in
<A href="</A></P> <P>The problems appears if i generate a ppt (only with the clone-function):<BR> -> pp2007 does't show any slide!! (in most of the tries, not ever)<BR> -> pp2003 opens and show the slides but if a change a slide, save and reopening the ppt the error (see in forum link) occurs.</P> <P>2. opening a generated ppt in pp2007 shows loosing logos for example which i can see if i open the same ppt in pp2003!<BR>For example you can test this with the first slide in the auma.ppt (see above). The logo on the right side will disappear in pp2007<BR><BR>I need your further assistence. Thank you in advance.</P> <P>ingo </P> <P> </P>

dear msfaiz,

is there any new information for me?

thank you in advance

Dear ingo,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The first problem has been fixed and will be available in the next hot fix.

We are already working on second problem and fix it as soon as possible.

Hi,

SortetList is not available in J2SE4.

What would you recommend in this case?

Thank you.

You can use TreeMap

TreeMap map = new TreeMap();
Presentation newPresentation = new Presentation();
p.cloneSlide(slide, 1, newPresentation, map);

dear msfaiz,

is there any new information for me?

thank you in advance

ingo

The problem relating to logos (clip arts) not showing in MS-PowerPoint 2007 is only partially resolved and needs more time. Sorry for inconvenience. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

dear msfaiz,

is there any new information for me?

thank you in advance

ingo