GetFieldsByName
DocumentData.GetFieldsByName method
名前が等しいフィールド データのコレクションを返しますfieldName.
public IList<FieldData> GetFieldsByName(string fieldName)
| パラメータ | タイプ | 説明 | 
|---|---|---|
| fieldName | String | フィールドの名前。 | 
戻り値
のコレクションFieldDataオブジェクト;フィールド データが見つからない場合は空のコレクション。
例
フィールド名でフィールドを検索:
FieldDataクラスはフィールドデータを表します。分野にもよりますがPageAreaproperty には、の継承者のいずれかを含めることができますPageAreaクラス。例えば、ParseForm method は、テキスト フィールドのみを抽出します。
// 「住所」という名前のすべてのフィールドを取得します
IList<FieldData> addressFields = data.GetFieldsByName("Address");
if(addressFields.Count == 0) {
    Console.WriteLine("Address not found");
}
else {
    Console.WriteLine("Address");
    // フィールド コレクションを反復処理します
    for (int i = 0; i < addressFields.Count; i++) {
        PageTextArea area = addressFields[i].PageArea as PageTextArea;
        Console.WriteLine(area == null ? "Not a template field" : area.Text);       
         
        // 関連フィールドの場合:
        if(addressFields[i].LinkedField != null) {
            Console.Write("Linked to ");
            PageTextArea linkedArea = addressFields[i].LinkedField.PageArea as PageTextArea;
            Console.WriteLine(area == null ? "Not a template field" : area.Text);           
        }
    }
}
関連項目
- class FieldData
 - class DocumentData
 - 名前空間 GroupDocs.Parser.Data
 - 組み立て GroupDocs.Parser