Hi,
I have an orignal file (pptx file) that I want to generate in PPTX and PDF with some of its DocumentProps modified.
The problem is that for :
==> the PPTX output, there is a problem with the TIME. It adds 2 hours
==> the PDF output, all is fine. No problem with the time
This was done with Aspose.Slides version : 20.6
All the elements are in the zip file, and all the explanations are in the word file explanations.docx
Thanks.
elements.zip (139.1 KB)
@julien.mevel.isilog,
It seems to be an issue while setting creation time document property. A ticket with ID SLIDESNET-42035 has been created to further investigate and resolve the issue. We will share the feedback with you as soon as the issue will be fixed.
@julien.mevel.isilog
Can you please try using following sample code on your end to set the documentation properties.
Please note that we have a special API to work with builtin properties:
IPresentationInfo info = PresentationFactory.Instance.GetPresentationInfo("OriginalDocument.pptx");
IDocumentProperties props = info.ReadDocumentProperties();
props.CreatedTime = DateTime.Now.AddDays(-5);
props.LastSavedTime = DateTime.Now.AddDays(-2);
info.UpdateDocumentProperties(props);
info.WriteBindedPresentation("OriginalDocument.pptx");
Hi,
I tried with your sample of code with a test project, i still have the problem
The original hour was 9:32 but builtin prop of the document register 11:32 for “Last modified” and “Created”
I attached the test file using your code :
elements.zip (47.3 KB)
@ISIWARE,
I reproduced the problem and logged the issue with ID SLIDESNET-42651 in our tracking system. Our development team will investigate this case further. I will inform you of any progress.
@ISIWARE,
Our development team investigated the issue. IDocumentProperties.CreatedTime
and IDocumentProperties.LastSavedTime
properties are expressed in UTC. DateTime.Now
returns the current time in the local timezone. Please try to use the ToUniversalTime
method as shown below:
props.CreatedTime = DateTime.Now.ToUniversalTime().AddDays(-5);
props.LastSavedTime = DateTime.Now.ToUniversalTime().AddDays(-2);