PDF フォームのサブセクション

フィールド名取得

The Documentize PDF Form for .NET は、PDF ドキュメントからインタラクティブなフォーム フィールド名を抽出し、迅速な識別と効率的なデータ処理を実現します。このツールは、開発者にすべての利用可能なフィールドを一覧表示するシンプルな方法を提供し、PDF フォームを自動化ワークフローに組み込みやすくします。特に、アンケート、契約書、レポートなど、正確なデータ抽出と統合のために正確なフィールド名が必要なアプリケーション構築時に有用です。

Quick Start: Get field names

​
1// Get field names
2var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));

PDF ファイルからすべてのフィールド名を取得する方法

PDF ドキュメントからすべてのフォーム フィールド名を取得する手順は以下のとおりです。

  1. GetFieldNamesOptions クラスのインスタンスを作成します。
  2. オプションに入力 PDF ファイルのパス(またはストリーム)を指定します。
  3. GetNames メソッドを呼び出してフィールド名を抽出します。
​
1// Create GetFieldNamesOptions object to set instructions
2var options = new GetFieldNamesOptions("path_to_your_pdf_file.pdf");
3// Perform the process and get names
4var fieldNames = PdfForm.GetNames(options);

PDF ストリームからすべてのフィールド名を取得する方法

​
1// Prepare input stream
2using var inputStream = File.OpenRead("path_to_your_pdf_file.pdf");
3// Get field names
4var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions(inputStream));

GetFieldNamesOptions の Input プロパティを設定する方法

ループ処理などで新しいインスタンスを毎回作成せずに使用したい場合に便利です。

​
1var options = new GetFieldNamesOptions();
2// Set input from a file
3options.Input = new FileData("path_to_your_pdf_file.pdf");
4// Or set input from a stream
5// options.Input = new StreamData(stream);
6var results = PdfForm.GetNames(options);

主な機能

  • Get Field Names: PDF ドキュメントからすべてのインタラクティブ フォーム フィールド名を抽出し、容易に識別・処理できるようにします。
  • Flexible Input Sources: ファイル パスとストリームの両方に対応し、さまざまな .NET ワークフローへのシームレスな統合を可能にします。

フォームフィールドのフラット化

The Documentize PDF Form for .NET allows you to convert interactive PDF forms into non-editable documents, making them secure from unauthorized modifications. This tool transforms form fields into static content, enhancing the security of your PDF documents. It is particularly useful when you need to secure contracts, agreements, or any document where form fields must remain unchanged.

PDFでフォームフィールドをフラット化する方法

To flatten form fields in a PDF document, follow these steps:

  1. Create an instance of the FlattenFieldsOptions class.
  2. Add the input and output files to the options.
  3. Call the Flatten method to perform the flattening operation.
​
1 // Create FlattenFieldsOptions object to set instructions
2 var options = new FlattenFieldsOptions();
3 // Add input file path
4 options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
5 // Set output file path
6 options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
7 // Perform the process
8 PdfForm.Flatten(options);

PDFで最初のフィールド以外すべてをフラット化する方法

You can selectively flatten only specific form fields based on criteria such as the field’s position or name.

​
 1 // Get Fields Names
 2 var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));
 3 // Create FlattenFieldsOptions object to set instructions
 4 var options = new FlattenFieldsOptions();
 5 options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
 6 options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
 7 // Skip 1 field.
 8 options.SkipFields.Add(fieldNames[0]);
 9 // Perform the process
10 PdfForm.Flatten(options);

主な機能:

  • すべてのフォームフィールドをフラット化: インタラクティブなフォームフィールドを編集不可な静的コンテンツに変換します。
  • 選択したフィールドだけをフラット化: PDF 内の特定のフィールドだけをフラット化し、他のフィールドは編集可能なままにします。
 日本語