generate_documents_multiple
Generate multiple documents from a single template and JSON/XML data, outputting each as PDF, Word, Excel, or HTML. Automatically saves files to your directory.
Instructions
Generate multiple documents from one template and data using PDF4me GenerateDocumentMultiple API (POST /api/v2/GenerateDocumentMultiple). Supports async polling on 202; saves each output from outputDocuments[].streamFile.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"template_file_path": "<template_file_path>",
"template_file_type": "<template_file_type>",
"template_file_name": "<template_file_name>",
"document_data_type": "<document_data_type>",
"output_type": "<output_type>",
"output_dir": "<output_dir>",
"output_file_name": "<output_file_name>"
},
"name": "generate_documents_multiple"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_dir | Yes | Directory where generated files are written. | |
| output_type | Yes | Desired output format (PDF, Docx, Html, Excel, Word). | |
| file_meta_data | No | Optional fileMetaData string. | |
| meta_data_json | No | Optional metaDataJson string. | |
| output_file_name | Yes | Base output file name; multiple files use name_1.ext, name_2.ext, etc. | |
| document_data_type | Yes | Json or XML. | |
| template_file_name | Yes | File name for the template in the request. | |
| template_file_path | Yes | Local path to the template file. | |
| template_file_type | Yes | Template kind sent to the API (e.g. Docx, Html, Pdf, Word). | |
| document_data_file_path | No | Local file read as base64 for documentDataFile. | |
| document_data_text_path | No | Path to a UTF-8 file whose contents are sent as documentDataText. |