FIll PDF Form Date Field

When filling a PDF that contains a date field, after setting this value as:
8/30/18
the pdf shows as:
//18.

The values are filled like this:
Document pdfDocument = new Document(@“D:\PDF\Test3.pdf”);
Field dateField = pdfDocument.Form.Fields[2];
dateField.Value = de.Value.ToString();

After you make click on the field, it displays the correct value, and when you leave the field it goes back to the incorrect value.

Am I doing anything wrong?

Leonardo

@leonardotraffk

Thank you for contacting support.

We would like to request you to share respective PDF file with us while specifying the name of field explicitly. Also attach some screenshots to elaborate it a little more. We will try to reproduce and investigate it. Before sharing requested data, please ensure using Aspose.PDF for .NET 18.8 in your environment.

Yes, I am using Apsose.Pdf 18.8.

Here is a sample of the problem.

.Test3_20180903021951.pdf (82.8 KB)

@leonardotraffk

We can notice the problem in generated PDF file shared by you. However, we need your source PDF file to reproduce this issue in our environment so that we may proceed further to help you out.

Here is the source file:
Test3.pdf (22.1 KB)

@leonardotraffk

Thank you for sharing requested data.

We have been able to reproduce the issue with below code snippet in our environment. A ticket with ID PDFNET-45334 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

        Document pdfDocument = new Document(dataDir + "Test3.pdf");
        Aspose.Pdf.Forms.Form form = pdfDocument.Form;
        foreach (Aspose.Pdf.Forms.Field field in form.Fields)
        {
            if (field.FullName == "DateField1")
                field.Value = DateTime.Now.ToString("MM/dd/yyyy"); 
        }
        pdfDocument.Save(dataDir + "Test.pdf");

We are sorry for the inconvenience.

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 work around?

@jtmille3

At the moment, the issue is currently under investigation phase and we really regret that we cannot share any update or workaround until it is fully investigated. As soon as its analysis is complete, we will surely share updates in this forum thread. We really apologize for the inconvenience and delay caused.

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

What about the java version?

@jtmille3

Every fix in .NET Version is included in equivalent version of the Java API. In order words, same fix will be present in 21.3v of Aspose.PDF for Java.