Knowledge Base - Get/Set form fields in JSON format in Xamarin (Android)

You can get form fields info in JSON format, using RadaeePDFManager.JsonFormFields or RadaeePDFManager.GetJsonFormFieldsAtPage(pageno).

You can also set form fields values using RadaeePDFManager.SetFormFieldsWithJSON()

They must be called after the viewer is rendered.

The first API JsonFormFields returns info for all the form fields in the current opened document, the second one GetJsonFormFieldsAtPage returns the info only for the given page.

Example:

  • String formFields = mPdfManager.JsonFormFields;
    • "{\"Pages\":[{\"Page\":0,\"Annots\":[{\"Index\":0,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$FIRST_NAME\",\"FieldNameWithNO\":
      \"$FIRST_NAME\",\"FieldFullName\":\"$FIRST_NAME\",\"FieldFullName2\":\"$FIRST_NAME\",\"FieldFlag\":0,\"FieldFormat\":\"\",
      \"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",
      \"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":2,\"Name\":\"\",
      \"Type\":20,\"FieldName\":\"$LAST_NAME\",\"FieldNameWithNO\":\"$LAST_NAME\",\"FieldFullName\":\"$LAST_NAME\",\"FieldFullName2\":
      \"$LAST_NAME\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":
      -1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",
      \"SignStatus\":-1},{\"Index\":3,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$ADDRESS\",\"FieldNameWithNO\":\"$ADDRESS\",
      \"FieldFullName\":\"$ADDRESS\",\"FieldFullName2\":\"$ADDRESS\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,
      \"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,
      \"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":4,\"Name\":\"\",\"Type\":20,\"FieldName\":
      \"$APARTMENT\",\"FieldNameWithNO\":\"$APARTMENT\",\"FieldFullName\":\"$APARTMENT\",\"FieldFullName2\":\"$APARTMENT\",
      \"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,
      \"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",
      \"SignStatus\":-1},{\"Index\":5,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$CITY\",\"FieldNameWithNO\":\"$CITY\",\"FieldFullName\":
      \"$CITY\",\"FieldFullName2\":\"$CITY\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":
      -1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,
      \"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":6,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$STATE\",\"FieldNameWithNO\":
      \"$STATE\",\"FieldFullName\":\"$STATE\",\"FieldFullName2\":\"$STATE\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,
      \"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,
      \"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":7,\"Name\":\"\",\"Type\":20,
      \"FieldName\":\"$ZIP\",\"FieldNameWithNO\":\"$ZIP\",\"FieldFullName\":\"$ZIP\",\"FieldFullName2\":\"$ZIP\",\"FieldFlag\":0,
      \"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,
      \"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":
      8,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$HOME\",\"FieldNameWithNO\":\"$HOME\",\"FieldFullName\":\"$HOME\",
      \"FieldFullName2\":\"$HOME\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,
      \"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,
      \"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":9,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$DOB\",\"FieldNameWithNO\":
      \"$DOB\",\"FieldFullName\":\"$DOB\",\"FieldFullName2\":\"$DOB\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,
      \"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,
      \"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":10,\"Name\":\"\",\"Type\":20,
      \"FieldName\":\"$EMAIL\",\"FieldNameWithNO\":\"$EMAIL\",\"FieldFullName\":\"$EMAIL\",\"FieldFullName2\":\"$EMAIL\",\"FieldFlag\":
      0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,
      \"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1}]}]}"
  • String formFields = mPdfManager.GetJsonFormFieldsAtPage(0);
    • "{\"Page\":0,\"Annots\":[{\"Index\":0,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$FIRST_NAME\",\"FieldNameWithNO\":
      \"$FIRST_NAME\",\"FieldFullName\":\"$FIRST_NAME\", \"FieldFullName2\":\"$FIRST_NAME\",\"FieldFlag\":0,\"FieldFormat\":
      \"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1, \"ComboItemCount\":-1,
      \"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},
      {\"Index\":2,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$LAST_NAME\",\"FieldNameWithNO\":\"$LAST_NAME\",
      \"FieldFullName\":\"$LAST_NAME\", \"FieldFullName2\":\"$LAST_NAME\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":
      2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1, \"ComboItemCount\":-1,\"ListSels\":\"\",
      \"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":3,
      \"Name\":\"\",\"Type\":20,\"FieldName\":\"$ADDRESS\",\"FieldNameWithNO\":\"$ADDRESS\",\"FieldFullName\":\"$ADDRESS\",\"FieldFullName2\":\"$ADDRESS\",
      \"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,
      \"ComboItemCount\": -1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",
      \"SignStatus\":-1},{\"Index\":4,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$APARTMENT\",\"FieldNameWithNO\":
      \"$APARTMENT\",\"FieldFullName\":\"$APARTMENT\", \"FieldFullName2\":\"$APARTMENT\",\"FieldFlag\":0,\"FieldFormat\":
      \"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1, \"ComboItemCount\" :-1,
      \"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},
      {\"Index\":5,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$CITY\",\"FieldNameWithNO\":\"$CITY\",\"FieldFullName\":
      \"$CITY\",\"FieldFullName2\":\"$CITY\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,
      \"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1, \"ListSels\":\"\",\"ListItemCount\":-1,
      \"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":6,\"Name\":\"\",\"Type\":20,
      \"FieldName\":\"$STATE\",\"FieldNameWithNO\":\"$STATE\",\"FieldFullName\":\"$STATE\",\"FieldFullName2\":\"$STATE\",
      \"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,
      \"ComboItemCount\":-1, \"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":
      \"\",\"SignStatus\":-1},{\"Index\":7,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$ZIP\",\"FieldNameWithNO\":\"$ZIP\",
      \"FieldFullName\":\"$ZIP\",\"FieldFullName2\":\"$ZIP\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,
      \"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1, \"ListSels\":\"\",
      \"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":8,
      \"Name\":\"\",\"Type\":20,\"FieldName\":\"$HOME\",\"FieldNameWithNO\":\"$HOME\",\"FieldFullName\":\"$HOME\",
      \"FieldFullName2\":\"$HOME\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1, \"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":9,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$DOB\",\"FieldNameWithNO\":\"$DOB\",\"FieldFullName\":\"$DOB\",\"FieldFullName2\":\"$DOB\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":
      -1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1, \"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",
      \"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":10,\"Name\":\"\",\"Type\":20,\"FieldName\":
      \"$EMAIL\",\"FieldNameWithNO\":\"$EMAIL\",\"FieldFullName\":\"$EMAIL\",\"FieldFullName2\":\"$EMAIL\",\"FieldFlag\":0,
      \"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,
      \"ComboItemCount\":-1, \"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":
      \"\",\"SignStatus\":-1}]}"
  • mPdfManager.SetFormFieldsWithJSON("{\"Pages\":[{\"Page\":0,\"Annots\":[{\"Index\":0,\"Name\":\"\",\"Type\":20,\"FieldName\":
    \"$FIRST_NAME\",\"FieldNameWithNO\":\"$FIRST_NAME\",\"FieldFullName\":\"$FIRST_NAME\",\"FieldFullName2\":\"$FIRST_NAME\",
    \"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,
    \"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"My First Name\",\"EditType\":1,
    \"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":2,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$LAST_NAME\",
    \"FieldNameWithNO\":\"$LAST_NAME\",\"FieldFullName\":\"$LAST_NAME\",\"FieldFullName2\":\"$LAST_NAME\",\"FieldFlag\":0,
    \"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,
    \"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},
    {\"Index\":3,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$ADDRESS\",\"FieldNameWithNO\":\"$ADDRESS\",\"FieldFullName\":
    \"$ADDRESS\",\"FieldFullName2\":\"$ADDRESS\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,
    \"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":
    \"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":4,\"Name\":\"\",\"Type\":20,\"FieldName\":
    \"$APARTMENT\",\"FieldNameWithNO\":\"$APARTMENT\",\"FieldFullName\":\"$APARTMENT\",\"FieldFullName2\":\"$APARTMENT\",
    \"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,
    \"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",
    \"SignStatus\":-1},{\"Index\":5,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$CITY\",\"FieldNameWithNO\":\"$CITY\",
    \"FieldFullName\":\"$CITY\",\"FieldFullName2\":\"$CITY\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,
    \"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":
    -1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":6,\"Name\":\"\",\"Type\":20,
    \"FieldName\":\"$STATE\",\"FieldNameWithNO\":\"$STATE\",\"FieldFullName\":\"$STATE\",\"FieldFullName2\":\"$STATE\",
    \"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,
    \"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":
    \"\",\"SignStatus\":-1},{\"Index\":7,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$ZIP\",\"FieldNameWithNO\":\"$ZIP\",
    \"FieldFullName\":\"$ZIP\",\"FieldFullName2\":\"$ZIP\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,
    \"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":
    -1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":8,\"Name\":\"\",\"Type\":20,
    \"FieldName\":\"$HOME\",\"FieldNameWithNO\":\"$HOME\",\"FieldFullName\":\"$HOME\",\"FieldFullName2\":\"$HOME\",
    \"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,
    \"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",
    \"SignStatus\":-1},{\"Index\":9,\"Name\":\"\",\"Type\":20,\"FieldName\":\"$DOB\",\"FieldNameWithNO\":\"$DOB\",
    \"FieldFullName\":\"$DOB\",\"FieldFullName2\":\"$DOB\",\"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,
    \"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,\"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":
    -1,\"EditText\":\"\",\"EditType\":1,\"EditTextFormat\":\"\",\"SignStatus\":-1},{\"Index\":10,\"Name\":\"\",\"Type\":20,
    \"FieldName\":\"$EMAIL\",\"FieldNameWithNO\":\"$EMAIL\",\"FieldFullName\":\"$EMAIL\",\"FieldFullName2\":\"$EMAIL\",
    \"FieldFlag\":0,\"FieldFormat\":\"\",\"FieldType\":2,\"CheckStatus\":-1,\"ComboItemSel\":-1,\"ComboItemSelItem\":-1,
    \"ComboItemCount\":-1,\"ListSels\":\"\",\"ListItemCount\":-1,\"EditText\":\"This email address is being protected from spambots. You need JavaScript enabled to view it.\",\"EditType\":1,
    \"EditTextFormat\":\"\",\"SignStatus\":-1}]}]}");

 

 

Applies To

RadaeePDF SDK for Xamarin

Details

Created : 2017-03-22 09:02:31, Last Modified : 2022-03-21 17:51:52

Order history

Login to handle your order history.