Free Support Forum - aspose.com

Change Creation and Modify Date

Dear Sir or Madam,

We have a problem to change creation date and the modify date from xmp-default meta data. We need the timezone information. Here the code:

oXmpMetaData.BindPdf(m_sPDFAPath + sPDFFileName)

'change create date
oXmpMetaData(DefaultMetadataProperties.CreateDate) = System.DateTime.Now.ToString("yyyy-MM-ddThh:mm:ss%K")

'change meta data date
oXmpMetaData(DefaultMetadataProperties.MetadataDate) = System.DateTime.Now.ToString("yyyy-MM-ddThh:mm:ss%K")

'change modifydate
oXmpMetaData(DefaultMetadataProperties.ModifyDate) = System.DateTime.Now.ToString("yyyy-MM-ddThh:mm:ss%K")

'save xmp meta data in the pdf file
oXmpMetaData.Save(m_sPDFAPath + sPDFFileName)

'close the object
oXmpMetaData.Close()

The Problem is, that Aspose overwrites the createDate and ModifyDate with a "wrong" Timeformat as you can see in xmp-Metadaten.xml:

<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
2013-02-12T10:15:48+01:00
2013-02-12T10:15:45Z
2013-02-12T10:15:48Z
Aspose Ltd.

In the value for Create and Modify date the TimeZone information is missed, although it was added in the format-String. You can compare with the result of the MetadataDate. There it is correct.

We think aspose overwrites our "custom" date.

Please help.

Best Regards,
André Martens

Edit:

We did further analyzes and we found the following issue. Aspose save all documents with GMT, but we are in GMT+01:00 (see on PDF section in file properties). As a result we got Problems in the pdf conformance verification prozess:
1. "Creation date mismatch between Document Info and XMP Metadata"
2. "Last Modification Date mismatch between Document Info and XMP Metadata"

Why did aspose not use local system timezone to save pdf files?

Hi Andre,


Sorry for the inconvenience faced. We have noticed you are using an old API version, Aspose.Pdf 7.5.0. Can you please download and try latest Aspose.Pdf Api from here? Hopefully it will resolve your issue.
If issue persist then please share your sample input/output document here for further investigation.

Best Regards,

Hi Ahmad,

with the new version all problems are solved.

Thank you.

Kind Regards,
André