Fill PDF Forms using Aspose.PDF for .NET - Fill Date Wrong Year

We are filling forms and having a problem with a date selection field (its their date of birth). When we fill it with Aspose the result is it turns 6/18/1972 into 6/18/3872. If you open the PDF inside of Adobe it displays incorrectly, but if you click the field you then see the 6/18/1972 that was filled from Aspose. When you leave the field it goes back to 6/18/3872. If you type the date manually inside of Adobe it displays fine.

We have recently upgraded from an older version to the latest 18.1 and that is when the problem surfaced.

I am using 18.1 .NET and filling it with ToShortDateString()

1 Like

@Mattsobs

Thanks for contacting support.

Would you please share your sample PDF document along with sample code snippet, which you are using to fill the date field, so that we can test the scenario in our environment and address it accordingly.

ApplicationEnglish (1).pdf (1.0 MB)
SANOFI Application.pdf (470.2 KB)

See Attached.

@Mattsobs

Thanks for sharing the sample PDF document.

We have tested the scenario using following code snippet and were able to replicate the issue in our environment with Aspose.PDF for .NET 18.1. Hence, we have logged this issue as PDFNET-44080 in our issue tracking system, for the sake of correction. We will further investigate the issue and keep you informed with the status of its rectification. Please be patient and spare us little time.

Document pdfDocument = new Document(dataDir + "ApplicationEnglish (1).pdf");
Form form = pdfDocument.Form;
foreach(Field field in form.Fields)
{
 if (field.FullName == "PDOB")
   field.Value = DateTime.Now.ToString("MM/dd/yyyy"); // ToShortDateString is also giving same results
}
pdfDocument.Save(dataDir + "Filled.pdf");

We are sorry for the inconvenience.

I have upgraded to 19.9.0 and now this issue is happening again. I have tried workarounds, but they don’t seem to be working.

Is there a new fix or workaround for this?

@Mattsobs

We regret to share that earlier logged issue is not yet resolved due to other high priority issues and implementations. We will surely look into the details of the issue and will share updates with you as soon as we have some. Please spare us little time.

We are sorry for the inconvenience.

Do you have any updates on this case? we are also experiencing the issue.

@sigma

Regretfully there no updates at the moment regarding issue resolution. We have logged your concerns as well and will surely inform you as soon as the issue is resolved. Please spare us some time.

We are sorry for the inconvenience.

I’m wondering if issue PDFNET-44080 is fixed. We are using older version and see this issue.

Thanks
Timir

@timirp

Regretfully the logged ticket is not yet resolved. We will surely inform within this forum thread as soon as we have some updates regarding its resolution. Please spare us some time.

Any updates on this issue?

This has been open a long time now. I’m version 20.6 and this is still an issue. Is there any update on the timeframe for a fix? Or at least a suggested workaround?

@zhaolang, @jtmille3

We are afraid that earlier logged ticket could not get resolved due to other issues logged prior to it. However, it is currently under the phase of investigation and as soon as we complete its analysis we will share updates in this forum thread. Your patience and comprehension is greatly appreciated in this regard.

We apologize for the inconvenience caused.

The issues you have found earlier (filed as PDFNET-44080) have been fixed in Aspose.PDF for .NET 22.12.