When i use Save(stream) or Save(filename), it works fine - i set the ModDate and CreationDate programatically to UTC+3 (current time, or any other time), and it works just fine.
When i use Save() it (Aspose) modifies it to a UTC datetime - i set both ModDate and CreationDate (like for the above), and Aspose modify ModDate to the current UTC datettime. It does not change CreationDate.
Thanks for your feedback. My apologies I mixed the CreationDate and ModDate with Producer field. you may keep ModDate of document using DocumentInfo class as following. Hopefully it will help you to accomplish the task
Document doc = new Document(myDir+“HelloWorld.pdf”);
I must use the Save() to save the PDF inplace, with an incremental update.
Hi Vadim,
I have tested the scenario using above stated code and I am afraid I am getting A first chance exception of type ‘System.ArgumentException’ at System.IO.BinaryWriter…ctor(Stream output, Encoding encoding, Boolean leaveOpen). However when using following code snippet, I am able to see the Modify Date is being set to current date time and it is correct behavior. The API adds current system date/time stamp over which the document is modified.
[C#]
using (FileStream stream = newFileStream(“c:/pdftest/test
(1).pdf”, FileMode.OpenOrCreate))<o:p></o:p>
using (Document doc = newDocument("HelloWorld.pdf"))
{
DocumentInfo docinfo = newDocumentInfo(doc);
docinfo.ModDate = DateTime.Now.AddDays(-1);
doc.Save();
}
doesn't work.
I must use the Save() to save the PDF inplace, with an incremental update.
Thanks for your feedback. Your suggested code throws exception. However if we pass document as stream for incremental save exception does not occurs. But ModDate is not updated, we have logged an investigation ticket as PDFNEWNET-37430 for further investigation and resolution. We will keep you updated about the issue resolution progress.