Image to Word API
Convert an image to Word through typed conversion.
Feature
Request Mode
| Item | Value |
|---|---|
| Authentication | x-api-key: your_api_key_here |
| Request URL | POST http://localhost:8080/api/v1/process/img/docx |
| Content type | multipart/form-data |
| Success response | DOCX file stream |
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
file | File | Source file. Recommended extension: .jpg,.png,.jpeg,.bmp. | Yes |
options | String | JSON string containing the feature options below. | No |
password | String | Source file open password, used for password-protected PDFs. | No |
Options Parameters
Put the following fields in the options JSON string.
| Parameter | Type | Purpose |
|---|---|---|
enableOcr | Integer or String | Whether to use OCR. 0 = disabled, 1 = enabled. |
outputFileName | String | Optional output filename. When present, it is used as the preferred download filename. |
Request Example
bash
curl -X POST "http://localhost:8080/api/v1/process/img/docx" \
-H "x-api-key: your_api_key_here" \
-F "[email protected]" \
-F 'options={"enableOcr":0}'Response
On success, the API returns the converted file stream with Content-Type and Content-Disposition headers. On failure, the ComPDF Self-hosted returns a normalized error JSON response.