Free Support Forum - aspose.com

Change Created and Modified Date in PDF file information in C# using Aspose.PDF for .NET

I have the attached PDF and no matter what I do the properties displayed in Acrobat Reader are not being updated.
I am trying to update the ModDate and the CreatedDate. If I read the PDF in ASPOST.PDF the fields have changed but when opened in Acrobat the fields show the old values.

What is going on here? Other PDF files do not suffer from this problem.

a test PDF.pdf (45.4 KB)

            Aspose.Pdf.License license = new Aspose.Pdf.License();
            license.SetLicense("Aspose.Total.lic");
            try
            {
                Aspose.Pdf.Document frm = new Aspose.Pdf.Document(openFileDialog1.FileName);
                frm.Info.Clear();
                frm.Info.Title = string.Empty;
                frm.Info.ModDate = DateTime.Today.AddDays(-1);
                frm.Info.CreationDate = DateTime.Today.AddDays(-1);
                frm.Save(openFileDialog1.FileName);
            }
            catch (Exception ex)
            { }

@ggnuttall

Thanks for contacting support.

Would you please share the sample code snippet which you are using at your side to modify the PDF document? We will test the scenario in our environment and address it accordingly.

It has been nearly 2 months without reply. Has anyone seen my update with PDF and code to reproduce the issue?

@ggnuttall

We humbly apologize for the delay in response. Due to high traffic of inquiries in the forum, your post update was completely overlooked and we could not get back to you timely. We will definitely take care of such cases in the future, however, we humbly request you to please post a new reply instead of editing your first post. This way your post will be highlighted and can be attended timely.

Now concerning to the original issue, which you have reported, we have tested the scenario with latest version Aspose.PDF for .NET 18.5 while using your code snippet and were unable to notice the issue. The fields i.e ModifiedDate and CreatedDate, were updated correctly. For your kind reference, an output PDF document is also attached. a test PDF_out.pdf (45.4 KB)

Would you please test your scenario again while using latest version of the API. In case you still face any issue, please feel free to contact us.

We again apologize for keeping you wait this long. We are sorry for the inconvenience.

Here is a second PDF with the same issue. Is it possible that it has something to do with the Adobe version I am viewing the file with? It is Adobe Acrobat X.Opt-in notice signed 25.2.18.PDF (224.7 KB)
This was done with your latest version 18.5.0

I note the only difference with my ACTUAL code is there is a time component…

Could you please try this slight variation:
Aspose.Pdf.License license = new Aspose.Pdf.License();
//license.SetLicense(“Aspose.Total.lic”);
try
{
Aspose.Pdf.Document frm = new Aspose.Pdf.Document(openFileDialog1.FileName);
frm.Info.Clear();
frm.Info.Title = string.Empty;
frm.Info.Author = string.Empty;
DateTime test = new DateTime(1980, 12, 26, 1, 30, 30);
frm.Info.ModDate = test;
frm.Info.CreationDate = test;
frm.Save(openFileDialog1.FileName);
frm = null;
}
catch (Exception ex)
{ }

@ggnuttall

Thanks for getting back to us.

We were able to replicate the issue in our environment with your PDF document, while using Aspose.PDF for .NET 18.5. Therefore, we have logged an issue as PDFNET-44843 in our issue tracking system. We will further look into details of the logged issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

Any movement on this? It has been over 9 months!!

@ggnuttall

We regret to share that earlier logged issue could not get reviewed due to low priority and large number of pending issues in the queue. However, we do intend to review and investigate it soon while considering your recent concerns. As soon as some definite updates are available about its rectification, we will inform you. Please spare us little time.

We are sorry for the inconvenience.

Any Movement? I also note that the issue does not occur in PDF version 5 or less.

@ggnuttall

Thank you for getting back to us.

We are afraid it has not been resolved yet. However, would you please elaborate the version you are referring to, by PDF version 5. Please also share a sample PDF file for our reference, where issue does not occur.

I had all but given up!!! Have not renewed as required fixes have not been forthcoming. When I refer to the PDF Version I refer to the version reported when you choose the File->Save As-> Reduced Size PDF option. Anything saved as version 5 or less can have the Created and Modified date changed. Version 6-9 can change the created date but the modified date cannot be updated. Version 10 does not permit the updating of either the created date or the modified date.
I have attached 3 PDF files that you can test. All changed PDF version using Acrobat version X.Pages from AS332a V5 All good.pdf (26.0 KB)
Pages from AS332a V6 Create not modified.pdf (26.3 KB)
Pages from AS332a V7 Create not modified.pdf (26.3 KB)
Pages from AS332a V10 - Can’t Modify.pdf (26.2 KB)

Sorry - these results are for another Product PdfSharp (free) which works as outlined above. Aspose does not appear to work successfully with ANY PDF version.

@ggnuttall

We would like to inform you that your issue is being investigated - however, its investigation is not yet completed. We have logged all these details with the issue as well which you just provided. We will surely inform you as soon as the issue is resolved. We humbly apologize for this delay and inconvenience. Please spare us some time.