Free Support Forum - aspose.com

DateTime footer not updated

Hi Team,


We are generating slides from MS-PPT provided layouts.

The footer with DateTime is not updated automatically on slide generation.

It shows date time of file creation/ layout creation.

Please find attached sample files.

The Footer_Backgroud_ppt.pptx is layout used to generate the slide.

The Footer_Output.pptx is generated file which shows footer with date 10/9/2012… (It should be 10/11/2012).

Code to create slide:

LayoutSlideEx ls0 = ProcessingPresentation.LayoutSlides.GetByType(SlideLayoutTypeEx.TitleAndObject);
ProcessingPresentation.Slides.AddEmptySlide(ls0);

Hope data provided is sufficient to analyze and reproduce issue at your end.

Thanks and Regards,
Nakul

One more thing… the layout used to generate has DateTime in footer with Update Automatically and when we generate it we see it as Fixed.

I resolved it with below code


currentSlide.Parent.UpdateDateTimeFields = true;

But ideally the layout properties must be preserved.

Thanks
Nakul

Hi Nakul,


Thanks for inquiring Aspose.Slides.

I have observed and worked over the scenario shared by you. I like to share that what Aspose.Slides performed in generating slides is perfectly normal as per implementation. If you observe the document properties of your presentation, the last modified date for your presentation, its same as 10/09/2012. Also, PresentationEx.UpdateDateTimeFields is set to false by default. So, it take in account the last saved value of date. For some customer this can be their requirement. You have pointed out rightly that setting PresentationEx.UpdateDateTimeFields to true done the trick for you. In fact this is the right way to proceed. You will even observe that if you add the slide and then set PresentationEx.UpdateDateTimeFields to true, the date will not effect the added slide. So, you need to set the presentation level properties first and then add the slides to see the impact.

Many Thanks,

Thanks Mudassir for quick reply.


I have corrected it as per post.

If we use template with Fixed date , then also it will be update automatically.
There for i think the cloned layout should be same as of template layout. It should inherit all properties from template.


Hi Nakul,


Thanks for your comments but I like to share that the feature for updating the slide number and date time field is a presentation level property therefore it is not set as slide cloning level as that is slide level property. To give you an example for further elaboration on setting properties at their respective level; suppose you have a presentation that a has some custom slide size and you need to clone presentation to some target presentation. When you will clone the slides to target presentation the cloned presentation will not have that slide size which was set in source presentation. You will be needed to set the slide size of target presentation to that of source presentation to make things look similar. This behaviour is logical as well because one can clone slides from different source presentations and in one source presentation you have updated date time and in other presentation, its vice versa. In that case it will be a conflict in target presentation, so these properties are kept on presentation level so that you may set them accordingly as per your convenience. Hope this will elaborate the reason before you.

Many Thanks,