PDF Fill Date Wrong Year


#1

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()


#2

@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.


#3

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

See Attached.


#4

@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.


#5

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?


#6

@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.