Class PdfForm

情報

Documentize.PdfForm プラグインを表します。フラット化、フォームデータの抽出に使用します。また、フィールド名の取得も可能です。

Represents Documentize.PdfForm plugin. Used to Flatten, Extract Forms Data. Also allows you to Get Fields Names.

public static class PdfForm

Inheritance

objectPdfForm

Inherited Members

メソッド

Extract(ExtractFormDataToDsvOptions)

PDF ドキュメントからフォーム データを抽出します。

public static ResultContainer Extract(ExtractFormDataToDsvOptions options)

パラメーター

戻り値

ResultContainer : 操作の結果を含むオブジェクト。

この例はフォームの値を CSV ファイルにエクスポートする方法を示します。

// Create ExtractFormDataToDsvOptions object to set instructions
var options = new ExtractFormDataToDsvOptions(',', true);
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_csv_file.csv"));
// Perform the process
PdfForm.Extract(options);

例外

ArgumentException

オプションが設定されていない場合。

Flatten(FlattenFieldsOptions)

PDF ドキュメント内のフィールドをフラット化します。

public static ResultContainer Flatten(FlattenFieldsOptions options)

パラメーター

戻り値

ResultContainer : 操作の結果を含むオブジェクト。

この例は PDF ファイルのフィールドをフラット化する方法を示します。

// Create FormFlattenerOptions object to set instructions
var options = new FormFlattenerOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfForm.Flatten(options);

この例は PDF ファイルのフィールドをフラット化し、最初のフィールドをスキップする方法を示します。

// Get Fields Names
var fieldNames = PdfForm.GetFieldNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));
// Create FormFlattenerOptions object to set instructions
var options = new FormFlattenerOptions();
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Skip 1 field.
options.SkipFields.Add(fieldNames[0]);
// Perform the process
PdfForm.Flatten(options);

例外

ArgumentException

オプションが設定されていない場合。

GetNames(GetFieldNamesOptions)

PDF ドキュメント内のフィールド名を取得します。

public static List<string> GetNames(GetFieldNamesOptions options)

パラメーター

戻り値

List<string>

PDF ドキュメント内の名前のリスト。

この例は PDF ファイルからフィールド名を取得する方法を示します。

// Get Fields Names
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));

Remove(RemoveFieldsOptions) : Remove Fields from PDF document.

public static ResultContainer Remove(RemoveFieldsOptions options)

パラメーター

戻り値

ResultContainer : 操作の結果を含むオブジェクト。

この例は PDF ファイルからフィールドを削除する方法を示します。

// Create RemoveFieldsOptions object to set instructions
var options = new RemoveFieldsOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfForm.Remove(options);

例外

ArgumentException

オプションが設定されていない場合。

Namespace: Documentize Assembly: Documentize.dll

 日本語