We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

ISlides Insert() not working as expected

Thread ID:

Created:

Updated:

Platform:

Replies:

129137 Feb 28,2017 02:22 PM Mar 2,2017 01:03 AM ASP.NET Web Forms 3
loading
Tags: Presentation
Brian B
Asked On February 28, 2017 02:22 PM

Hello,

I am attempting to use ISlides Insert() per

http://help.syncfusion.com/cr/cref_files/wpf/presentation/Syncfusion.Presentation.Base~Syncfusion.Presentation.ISlides~Insert.html

I am using an existing presentation (.pptx) file and cloning a desired slide via Clone().  After saving the presentation and loading it in PowerPoint, PowerPoint informs me that the file is corrupted and offers to repair it.

Am I using Insert() correctly?

Thank you.


Snippet:

using (IPresentation presentation = Presentation.Open(@"template v2.pptx"))
{
ISlide slideModels = presentation.Slides[3];
ISlide slideModels_clone = slideModels.Clone();

presentation.Slides.Insert(2, slideModels_clone);

presentation.Save(outputPath);                

presentation.Close();
}

Devisri Jothi [Syncfusion]
Replied On March 1, 2017 12:06 AM

Hi Brian, 
Thank you for contacting Syncfusion support. 
Am I using Insert() correctly? 
Yes, we checked the provided code snippet and it is the correct way to insert slide in any presentation. 
Sample 
We have created a sample that loads a PowerPoint presentation and inserts a cloned slide at specific index in the slide collection. On saving the presentation, the resultant file is not corrupted as reported.  
You may download the sample from the below link, 
We suspect that a specific content in the slide of the template used at your end corrupts the resultant presentation while preforming insert operation to the cloned slide.  
Could you please provide us your input template so that it will be helpful for us to proceed further with this? 
Regards, 
Devisri. 


Brian B
Replied On March 1, 2017 11:55 AM

Hi, Devisri,

Thanks for your prompt reply & assistance.

I was able to successfully use Insert() with the EssentialPresentation.pptx that you supplied, and noted that it was created with Office 365 (internally v. 16.x).  I was also able to create a new .pptx using Office 2013, read it, clone a slide, insert it into the presentation, save the presentation, and read it successfully using Office 2013.

http://superuser.com/questions/664355/which-version-of-powerpoint-was-used-to-create-a-document and http://portal.presentationpro.com/kb/a192/how-do-i-tell-what-version-office-powerpoint-my-computer.aspx were useful in determining internal version numbers of the .pptx files with which I'm working.

I have only Office 2013 (internally version 15.x) and that is also the version used to create the attached AnonymizedOffice2013Template.pptx.

So, it appears you supposition about the possibility of content inside the template .pptx is likely correct.  Can you examine AnonymizedOffice2013Template.pptx and/or work with it to reproduce what I'm seeing?


Thank you,
Brian

Attachment: AnonymizedOffice2013Template_f11eeec0.zip

Devisri Jothi [Syncfusion]
Replied On March 2, 2017 01:03 AM

Hi Brian, 
Thank you for your update. 
We checked the provided PowerPoint presentation – “AnonymizedOffice2013Template.pptx”. We are able to reproduce the scenario “Output presentation gets corrupted while inserting a cloned slide to a template”
A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates 
Please let me know if you have any question.  
Regards, 
Devisri 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;