The Adoeb LiveCycle "Save as Static Form" option creates a parallel AcroForm
fields setup, parrallel to Adobe's proprietary XFA
fields.
When you use PDFNet's Field class methods, these are interacting with
the AcroForm, and not the XFA (which is in embedded xml in the PDF).
LiveCycle sets up some sort of connection between the XFA and AcroForm
fields.
The
key word in the Adobe LieCycle option is the word Static. I don't think
these are meant to be modified other than by someone filling out the
fields.
One of the reasons they introduced the idea of Static
Fields, is that Adobes own mobile reader software (iOS, Android) can't handle XFA.
The
particular issue that you encountered is that Field.RefreshAppearance
will break the implicit connections to the XFA data, so the XFA entry is
removed.
You can rename the XFA entry, change the
fields, and then
restore afterwards.
doc.GetAcroForm().Rename("XFA","XFA_TEMP");
However,
this might break the link still. You would then have to modify the XFA
XML to change the corresponding value entry in the XFA. See our forums
on how to get the XML from XFA.