> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AddNewPageEx

> AddNewPageEx Web Services API メソッドを使用して、ファイルからページ画像を FlexiCapture Document に追加します。

<div id="what-it-does">
  ## 機能
</div>

ファイルからDocumentにページ画像を追加します。このメソッドは、以前のバージョンの Web Services API における [AddNewPage](/ja/flexi-capture/api/methods/add-new-page) メソッドに代わるものです。

追加した画像には、前処理後にのみアクセスできます。画像の追加後、[ProcessBatch](/ja/flexi-capture/api/methods/process-batch) メソッドを使用してバッチ処理を開始します。また、[OpenTask](/ja/flexi-capture/api/methods/open-task) メソッドで開いたタスク内のDocumentに画像を追加した場合は、[CloseTaskEx](/ja/flexi-capture/api/methods/close-task-ex) メソッドを使用してタスクを閉じ、**Import** ステージに送信します。

<div id="definition">
  ## 定義
</div>

```csharp theme={null}
int AddNewPageEx(int sessionId, int batchId, int documentId, PageEx page, File file);
```

<div id="parameters">
  ## パラメーター
</div>

| 名前           | 型                                                  | 説明                         |
| ------------ | -------------------------------------------------- | -------------------------- |
| `sessionId`  | `int`                                              | Application Server への接続 ID |
| `batchId`    | `int`                                              | Documentを含むバッチの ID         |
| `documentId` | `int`                                              | ページを追加するDocumentの ID       |
| `page`       | [PageEx](/ja/flexi-capture/api/structures/page-ex) | ページの説明                     |
| `file`       | [File](/ja/flexi-capture/api/structures/file)      | ページ画像を含むファイル               |

<div id="add-a-page-image-with-a-post-request">
  ## POST リクエストを使用してページ画像を追加する
</div>

[POST リクエスト](/ja/flexi-capture/api/files/files)を使用して、ページ画像を追加することもできます。まず、このメソッドを使用して、画像なしのページを追加します。

次に、以下のパラメーターを指定して POST リクエストを実行します。

* `Action = Save`
* `objectType = 0`
* `objectId = documentId`
* `version = 0`
* `streamName = "Page pageId"`。ここで、`pageId` は `AddNewPageEx` メソッドから返されるページ ID です

<div id="returned-value">
  ## 戻り値
</div>

| 型     | 説明          |
| ----- | ----------- |
| `int` | 追加されたページのID |
