Generating PDF of slide at certain animation state

I’m looking to generate a PDF of each animation step in each slide in a presentation. Currently I can generate an entire PDF document from the presentation but the part of the process is how to generate a slide at each stage of its animation.


So if I had a slide with 3 bullet points and when you run the presentation each one of those points animation in on press of the spacebar. I would like to get a PDF output of that slide at each stage of that spacebar animation.

Do you know if this is possible and any thoughts on implementing it?

This message was posted using Page2Forum from AnimationSettings Class - Aspose.Slides for .NET

Hi Mupppets,


Thanks for your interest in Aspose.Slides.

I regret to share to share that the desired functionality of getting PDF or thumbnail of every animation step in slide is unavailable in Aspose.Slides. However, an issue with ID 25497 has already been created as a new feature request to provide this feature. I am sorry to share that at the moment there are no defined estimations available for this feature. However, I have requested our development team to share any possible update on this. We will share the information with you once it is shared by our development team.

Thanks and Regards,

Hi Mudassir,


I’ve managed to create the desired effect on PPT object model using the code below, in case anyone needs it.

                Presentation sourcePresentation = new Presentation(sourceFileInfo.FullFilePath);
SortedList sortedList = new SortedList();
            <span style="color:green;">// Slides list is copied as cloning causes modified collection exception</span>
            <span style="color:blue;">foreach</span> (<span style="color:#2b91af;">Slide</span> sourceSlide <span style="color:blue;">in</span> sourcePresentation.Slides.Cast<<span style="color:#2b91af;">Slide</span>>().OrderBy(s => s.SlidePosition).ToList())
            {
                <span style="color:#2b91af;">Presentation</span> targetPresentation = <span style="color:blue;">new</span> <span style="color:#2b91af;">Presentation</span>();
                <span style="color:#2b91af;">Slide</span> clonedSlide = GetClonedSlide(sourcePresentation, targetPresentation, sourceSlide);

                <span style="color:#2b91af;">MemoryStream</span> ms = <span style="color:blue;">new</span> <span style="color:#2b91af;">MemoryStream</span>();
                targetPresentation.Save(ms, Aspose.Slides.Export.<span style="color:#2b91af;">SaveFormat</span>.Pdf);

		    // TODO: Save PDF here
int animationCount = clonedSlide.Shapes.Cast<Shape>().Where(s => s.AnimationSettings != null && s.AnimationSettings.EntryEffect != ShapeEntryEffect.None).Count();

                <span style="color:blue;">if</span> (animationCount > 0)
                {
                    <span style="color:blue;">for</span> (<span style="color:blue;">int</span> offsetAnimation = 0; offsetAnimation < animationCount; offsetAnimation++)
                    {
                        targetPresentation = <span style="color:blue;">new</span> <span style="color:#2b91af;">Presentation</span>();
                        clonedSlide = GetClonedSlide(sourcePresentation, targetPresentation, sourceSlide);

                        <span style="color:#2b91af;">List</span><<span style="color:#2b91af;">Shape</span>> shapesInAnimationOrder = clonedSlide.Shapes.Cast<<span style="color:#2b91af;">Shape</span>>().Where(s => s.AnimationSettings != <span style="color:blue;">null</span> && s.AnimationSettings.EntryEffect != <span style="color:#2b91af;">ShapeEntryEffect</span>.None).OrderBy(s => s.AnimationSettings.AnimationOrder).ToList();

                        <span style="color:blue;">for</span> (<span style="color:blue;">int</span> shapeIndex = offsetAnimation; shapeIndex < animationCount; shapeIndex++)
                        {
                            <span style="color:#2b91af;">Shape</span> shape = shapesInAnimationOrder[shapeIndex];

                            <span style="color:green;">//TODO: Support TextUnitEffect.AnimateByWord and AnimateByCharacter</span>
                            <span style="color:blue;">if</span> (shape.AnimationSettings.TextUnitEffect == <span style="color:#2b91af;">TextUnitEffect</span>.AnimateByParagraph)
                            {
                                <span style="color:blue;">int</span> paragraphCount = shape.TextFrame.Paragraphs.Count;

                                <span style="color:blue;">for</span> (<span style="color:blue;">int</span> paragraphIndex = 0; paragraphIndex < paragraphCount; paragraphIndex++)
                                {
                                    <span style="color:blue;">if</span> (shape.TextFrame.Paragraphs[paragraphIndex].Text.Any(c => <span style="color:#2b91af;">Char</span>.IsLetterOrDigit(c) || c == <span style="color:#a31515;">'_'</span>))
                                    {
                                        targetPresentation = <span style="color:blue;">new</span> <span style="color:#2b91af;">Presentation</span>();
                                        clonedSlide = GetClonedSlide(sourcePresentation, targetPresentation, sourceSlide);
                                        <span style="color:#2b91af;">Shape</span> clonedShape = clonedSlide.Shapes.Cast<<span style="color:#2b91af;">Shape</span>>().Where(s => s.AnimationSettings != <span style="color:blue;">null</span> && s.AnimationSettings.EntryEffect != <span style="color:#2b91af;">ShapeEntryEffect</span>.None).OrderBy(s => s.AnimationSettings.AnimationOrder).ToList()[shapeIndex];

                                        <span style="color:blue;">for</span> (<span style="color:blue;">int</span> i = clonedShape.TextFrame.Paragraphs.Count - 1; i >= paragraphIndex; i--)
                                            clonedShape.TextFrame.Paragraphs.RemoveAt(i);

                                        ms = <span style="color:blue;">new</span> <span style="color:#2b91af;">MemoryStream</span>();
                                        targetPresentation.Save(ms, Aspose.Slides.Export.<span style="color:#2b91af;">SaveFormat</span>.Pdf);

// TODO: Save PDF here
}
}
}
}
}
}
}


        public static Slide GetClonedSlide(Presentation srcPres, Presentation targetPres, Slide sourceSlide)
{
SortedList sl = new SortedList();
for (int i = 1; i <= srcPres.Slides.LastSlidePosition; i++)
{
Slide srcSlide = srcPres.GetSlideByPosition(i);
if (sourceSlide == srcSlide)
{
Slide targetSlide = srcPres.CloneSlide(srcPres.GetSlideByPosition(i), targetPres.Slides.LastSlidePosition, targetPres, sl);
                <span style="color:blue;">if</span> (srcSlide.Notes != <span style="color:blue;">null</span>)
                {
                    targetSlide.AddNotes();
                    <span style="color:blue;">for</span> (<span style="color:blue;">int</span> j = 0; j < srcSlide.Notes.Paragraphs.Count; j++)
                        targetSlide.Notes.Paragraphs.Add(<span style="color:blue;">new</span> <span style="color:#2b91af;">Paragraph</span>(srcSlide.Notes.Paragraphs[j]));
                    targetSlide.Notes.Paragraphs.RemoveAt(0);
                }

                <span style="color:green;">// The fresh presentation had a blank slide</span>
                targetPres.Slides.RemoveAt(0);

                <span style="color:blue;">return</span> targetSlide;
            }
        }

        <span style="color:blue;">return</span> <span style="color:blue;">null</span>;
    }

I'm looking to implement the code above on the PPTX object model.

Are you able to give advice on where to find something similar to Slide.AnimationSettings on SlideEx?

I'm assuming the use of SlideEx.Timeline.MainSequence? However, for each EffectEx, I'm unable to reach the shape / text that it is being applied on, do you know how I can do this?

Thanks

Neil

Hi Neil,


I have tried to understand the requirement shared by you and feel sorry to share that feature of getting slides animation order is unavailable for PPTX as in case of PPT. An issue with ID 31263 has been created in our issue tracking system as a new feature request to work on the possibility of implementing the said feature. This thread has been linked with the issue so that you may be automatically notified once the issue is resolved.

We are sorry for your inconvenience,

Was this added for PPTX?

It is exactly what I am after

Hi,


Thank you very much for sharing the sample code. This may certainly help other customers if they are looking for animation support.

Many Thanks,

Hi Paul,


I regret to share that the similar implementation in case of PPTX for above sample code is not available in Aspose.Slides. However, I have requested our development team to kindly share the sample code if it is possible to implement for PPTX. I also like to share that we are working over implementation of generating PDF/thumbnails for different animation steps of presentation. I will be able to share the further information with you as soon as it will be shared by our development team.

Many Thanks,

Did your developers have any luck adapting the sample code to PPTX

Hi Paul,


I have verified from our issue tracking system and regret to share that the issue created is pending and awaiting resolution. Actually, we have product release coming up and our development team is currently focusing on it along with Enterprise and Priority support issues. Also, the issues shared in Aspose.Slides are selected for investigation and resolution on first come and first serve basis after the resolution of paid Enterprise and Priority support issues. However, I have requested our development team to kindly share the work around if it is possible in case of PPTX and will be able to share the feedback with you as soon as it will be shared by them. I will really appreciate your patience in this regard.

Many Thanks,

Hi Paul,


Our development team has worked on your requirement for porting the shared code to work in case of PPTX. Unfortunately, the similar functionality is unavailable in case of PPTX at present, therefore we are unable to port the code to work for PPTX. However, I like to share that we are working over unification of Aspose.Slides Api for PPT and PPTX. The stable version of product release will be available by this year end or during Q1/2014. By then the requested feature will be incorporated automatically in Aspose.Slides.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESNET-31263) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Any documentation on how the fix is accessed?


Hi Paul,


Our development team has tried to investigated the requirement for mapping the PPT code to respective PPTX code but unfortunately there is no appropriate functionality in case PPTX available for shared code. However, I like to add here that we are working over merging of Aspose.Slides API for PPT and PPTX. The said API is expected to be released by Q4 of 2013 or Q1 of 2014. Once the merged API will be available, I am hopeful that the issue will be addressed automatically as there will be single code base for both PPT and PPTX.

We are sorry for your inconvenience,

does the latest release make the above possible?

Hi Paul,

I like to share that at present the concerned issue regarding generating the PDF of slide with animation states is still unresolved. We will share the feedback with you as soon as the issue will be resolved.

We are sorry for your inconvenience,

any progress on this before i start looking at other libraries?

Hi Paul,

The issue SLIDESNET-25497 is still not resolved. I have asked the development team to share an update and ETA regarding the issue. As soon as the information is available, we will update you via this thread.

Thanks & Regards,

Hi there-

I was wondering if this was ever resolved. I’m trying to implement a similar solution currently.

Justin