Class PdfForm
情報
Documentize.PdfForm コンポーネントを表します。Flatten、フォームデータの抽出に使用します。また、フィールド名の取得も可能です。
Documentize.PdfForm コンポーネントを表します。Flatten、フォームデータの抽出に使用します。
また、フィールド名の取得も可能です。
public static class PdfForm継承
継承されたメンバー
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object?)
- object.Equals(object?, object?)
- object.ReferenceEquals(object?, object?)
- object.GetHashCode()
メソッド
Extract(ExtractFormDataToDsvOptions)
PDF ドキュメントからフォームデータを抽出します。
public static ResultContainer Extract(ExtractFormDataToDsvOptions options)パラメータ
optionsExtractFormDataToDsvOptions: 操作の指示を含むオプション オブジェクト。
戻り値
ResultContainer : 操作結果を含むオブジェクト。
例
この例は、フォームの値を CSV ファイルにエクスポートする方法を示しています。
// Create ExtractFormDataToDsvOptions object to set instructions
var options = new ExtractFormDataToDsvOptions(',', true);
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_csv_file.csv"));
// Perform the process
PdfForm.Extract(options);この例は、フォームの値を TSV ファイルにエクスポートし、プロパティを設定する方法を示しています。
// Create ExtractFormDataToDsvOptions object to set instructions
var options = new ExtractFormDataToDsvOptions();
//Set Delimiter
options.Delimiter = '\t';
//Add Field Names to result
options.AddFieldName = true;
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_csv_file.tsv"));
// Perform the process
PdfForm.Extract(options);例外
オプションが設定されていない場合。
Flatten(FlattenFieldsOptions)
PDF ドキュメント内のフィールドをフラット化します。
public static ResultContainer Flatten(FlattenFieldsOptions options)パラメータ
optionsFlattenFieldsOptions: 操作の指示を含むオプション オブジェクト。
戻り値
ResultContainer : 操作結果を含むオブジェクト。
例
この例は、PDF ファイル内のフィールドをフラット化する方法を示しています。
// Create FlattenFieldsOptions object to set instructions
var options = new FlattenFieldsOptions();
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
PdfForm.Flatten(options);この例は、PDF ファイル内のフィールドをフラット化し、最初のフィールドをスキップする方法を示しています。
// Get Fields Names
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));
// Create FlattenFieldsOptions object to set instructions
var options = new FlattenFieldsOptions();
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Skip 1 field.
options.SkipFields.Add(fieldNames[0]);
// Perform the process
PdfForm.Flatten(options);例外
オプションが設定されていない場合。
GetNames(GetFieldNamesOptions)
PDF ドキュメント内のフィールド名を取得します。
public static List<string> GetNames(GetFieldNamesOptions options)パラメータ
optionsGetFieldNamesOptions: 操作の指示を含むオプション オブジェクト。
戻り値
PDF ドキュメント内の名前のリスト。
例
この例は、PDF ファイルからフィールド名を取得する方法を示しています。
// Get Field Names
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));Remove(RemoveFieldsOptions) : PDF ドキュメントからフィールドを削除します。
public static ResultContainer Remove(RemoveFieldsOptions options)パラメータ
optionsRemoveFieldsOptions: 操作の指示を含むオプション オブジェクト。
戻り値
ResultContainer : 操作結果を含むオブジェクト。
例
この例は、PDF ファイルからフィールドを削除する方法を示しています。
// Create RemoveFieldsOptions object to set instructions
var options = new RemoveFieldsOptions();
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
PdfForm.Remove(options);例外
オプションが設定されていない場合。
Namespace: Documentize
Assembly: Documentize.dll