Hello, I am running into an issue while populating a PDF file that is XFA. I am using UiPath to run a C# script that reads the PDF, pulls the XFA form from it, and then updates fields that I need updated via the script. The package the bot relies on to execute the script is itext 7. This works perfect except for one field. The field doesn’t seem any different than any of the other fields that need to be populated. The script doesn’t throw an error or anything. The PDF just doesn’t show a value when you open it for that specific field.
Has anyone ever experienced issues while trying to populate fields where for some odd reason 1 of the fields just never updated? I even checked the XML of the PDF. The field has the value in it, but when you open the PDF the field shows nothing.
@Anil_G - this is not a check box field. It is a date field, but not a typical date field with a calendar pop out or anything like that. It appears as a text field. I pulled the DOM doc of the PDF and saw that there were functions built in to check the format of the field. It should be entered as MM/dd/yyyy. I do this manually and it works. I do this via the script and it does not.
I even went as far as removing the functions that validate the field and set the edited DOM doc to the PDF. I manually confirmed that the validation was no longer checking the field. I could enter whatever value into it. But when the script ran, it still failed to show the value in the PDF.
@Anil_G - yes, I tried that too. As I mentioned before, the value is shown in the XML but not in the PDF. In the XML it appears without the slashes. So MMddyyyy. I tried to have the script enter the value that way as well, but it did not work. I tried a bunch of different date formats, none showed in the PDF.
@Anil_G - I haven’t seen that particular post, but doesn’t seem like it will help me since I need to utilize itext 7. That is related to itext 5, which does not work with the new ReFramework. I will say though that I already tried what the article mentioned where I update the XML via the script and then write that to the PDF instead of doing individual field updates with the new itext 7.
I can confirm though that other date fields work without any issue in the PDF via the script. There is a field that manually has a pop up calendar. I can enter a date through the script and the PDF shows the value when I open it for that field.
@supermanPunch - Thanks for the suggestion! Unfortunately that package only works for pure PDF Forms. My PDF is considered an XFA form, so it does not recognize the fields in it while trying out the activities.