GetPdfFormFieldsXml

Declaration

Delphi

function GetPdfFormFieldsXml : PAnsiChar; stdcall;

ActiveX

HRESULT _stdcall GetPdfFormFieldsXml([out, retval] BSTR* xmlString);

 

Description

This function is used to read the formfield values from the loaded document. The data is represented as XML, you get the name and the value of each field.


Return value

The return value is an XML which contains all formular elements with their values.

Sample output of GetPdfFormFieldsXml
<?xml version="1.0" encoding="UTF-8"?>
<FormFields>
  <FormFieldElement Name="Signature1">
    <Name>Signature1</Name>
    <Type>ftSignature</Type>
    <Value></Value>
    <Required>False</Required>
    <ReadOnly>False</ReadOnly>
    <Highlighted>False</Highlighted>
    <EditAble>False</EditAble>
    <FieldView>
      <Page>1</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>
      <Left>89,8000030517578</Left>
      <Top>594,599975585938</Top>
      <Right>239,800003051758</Right>
      <Bottom>664,299987792969</Bottom>
    </FieldView>
  </FormFieldElement>
  <FormFieldElement Name="Signature2">
    <Name>Signature2</Name>
    <Type>ftSignature</Type>
    <Value></Value>
    <Required>False</Required>
    <ReadOnly>False</ReadOnly>
    <Highlighted>False</Highlighted>
    <EditAble>False</EditAble>
    <FieldView>
      <Page>1</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>
      <Left>269,399993896484</Left>
      <Top>595,900024414062</Top>
      <Right>419,399993896484</Right>
      <Bottom>664,900024414062</Bottom>
    </FieldView>
  </FormFieldElement>
  <FormFieldElement Name="Text1">
    <Name>Text1</Name>
    <Type>ftEdit</Type>
    <Value></Value>
    <Required>False</Required>
    <ReadOnly>False</ReadOnly>
    <Highlighted>False</Highlighted>
    <EditAble>True</EditAble>
    <FieldView>
      <Page>2</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>
      <Left>115,599998474121</Left>
      <Top>470,700012207031</Top>
      <Right>265,600006103516</Right>
      <Bottom>492,700012207031</Bottom>
    </FieldView>
  </FormFieldElement>
  <FormFieldElement Name="Text2">
    <Name>Text2</Name>
    <Type>ftEdit</Type>
    <Value></Value>
    <Required>False</Required>
    <ReadOnly>False</ReadOnly>
    <Highlighted>False</Highlighted>
    <EditAble>True</EditAble>
    <FieldView>
      <Page>2</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>
      <Left>115,599998474121</Left>
      <Top>497,899993896484</Top>
      <Right>265,600006103516</Right>
      <Bottom>519,900024414063</Bottom>
    </FieldView>
  </FormFieldElement>
  <FormFieldElement Name="RadioButtonGender">
    <Name>RadioButtonGender</Name>
    <Type>ftRadio</Type>
    <Value>Yes</Value>
    <Required>False</Required>
    <ReadOnly>False</ReadOnly>
    <Highlighted>False</Highlighted>
    <EditAble>True</EditAble>
    <FieldView>
      <Page>2</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>
      <Left>64</Left>
      <Top>635,400024414062</Top>
      <Right>82</Right>
      <Bottom>653,400024414062</Bottom>
    </FieldView>
    <FieldView>
      <Page>2</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>
      <Left>64</Left>
      <Top>660,299987792969</Top>
      <Right>82</Right>
      <Bottom>678,299987792969</Bottom>
    </FieldView>
  </FormFieldElement>
  <FormFieldElement Name="CheckBox3">
    <Name>CheckBox3</Name>
    <Type>ftCheck</Type>
    <Value>Yes</Value>
    <Required>False</Required>
    <ReadOnly>False</ReadOnly>
    <Highlighted>False</Highlighted>
    <EditAble>True</EditAble>
    <FieldView>
      <Page>2</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>
      <Left>63</Left>
      <Top>552,799987792969</Top>
      <Right>81</Right>
      <Bottom>570,799987792969</Bottom>
    </FieldView>
  </FormFieldElement>
  <FormFieldElement Name="Optionsfeld1">
    <Name>Optionsfeld1</Name>
    <Type>ftRadio</Type>
    <Value>Off</Value>
    <Required>False</Required>
    <ReadOnly>False</ReadOnly>
    <Highlighted>False</Highlighted>
    <EditAble>True</EditAble>
    <FieldView>
      <Page>2</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>
      <Left>95</Left>
      <Top>732,900024414062</Top>
      <Right>148,800003051758</Right>
      <Bottom>782,700012207031</Bottom>
    </FieldView>
    <FieldView>
      <Page>2</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>a
      <Left>160,100006103516</Left>
      <Top>732,099975585938</Top>
      <Right>211,399993896484</Right>
      <Bottom>783,5</Bottom>
    </FieldView>
  </FormFieldElement>
  <FormFieldElement Name="Kombinationsfeld3">
    <Name>Kombinationsfeld3</Name>
    <Type>ftCombo</Type>
    <Value>Option1</Value>
    <Required>False</Required>
    <ReadOnly>False</ReadOnly>
    <Highlighted>False</Highlighted>
    <EditAble>True</EditAble>
    <FieldView>
      <Page>2</Page>
      <Index>0</Index>
      <Active>False</Active>
      <FontColor>0</FontColor>
      <Left>331,799987792969</Left>
      <Top>489,100006103516</Top>
      <Right>514,900024414063</Right>
      <Bottom>509,100006103516</Bottom>
    </FieldView>
  </FormFieldElement>
</FormFields>

 

Sample 

C#
// save formfield details into a xml
          
string fromfields = SignAPIv4.GetPdfFormFieldsXml();