Hi,
I can't since I don't have the environment to build the program.
And I faced with one more issue: if field's value are entered in html e.g.
<input type="text" name="f1" value="some value">
then the field is showing empty in Acrobat Reader DC (but looks OK in Chrome). When I click the field I see the value and can edit it. After editing it becomes visible in the document and during printing.
To solve this problem I've tried to process final file using PDFTK tool with the following options:
"PDFTK input.pdf output output.pdf need_appearances"
where 'need_appearances' means: "Sets a flag that cues Reader/Acrobat to generate new field appearances based on the form field values. Use this when filling a form with non-ASCII text to ensure the best presentation in Adobe Reader or Acrobat".
After processing the document looks OK in "Acrobat Reader DC".
Accordingly the provided patch is not full and solves only one issue.
To fix this issue you should change the following:
1. Find parent object of the field (also the /parrent option should be fixed to /parent as described in your patch):