Export API Server
Release 3.3.2602 and above.
Function Description
The Export API server downloads the images used in the editor, then converts the document into various formats such as HWPX or DOCX and returns the file.
Runtime Environment
The Export API Docker image must be requested through your sales representative.
This Export API execution module runs in a Docker container environment.
It can be used on Linux operating systems where Docker can be installed and executed.
The following are examples of verified environments:
- Ubuntu 18.04 and above
- CentOS 7 and above / RHEL 7 and above
- Debian 9 and above
- Fedora 30 and above
For production environments, execution on Linux (x86_64 / amd64) servers is recommended. In this environment, it runs natively without architecture emulation, providing the best performance and stability.
The container's internal runtime is based on the node:18-slim image, so there is no behavioral difference of the execution module depending on the host operating system.
It can also be run on macOS (Apple Silicon) and Windows environments via Docker Desktop, but architecture emulation may be used, so this is recommended for development and testing purposes only.
Execution Method
## Installation
# Load Docker image:
docker load -i export_api.tar
# Docker run
docker run -d --name export-api \
-p 9090:9090 \
-e REMOTE_SOURCE_PROXY_DOMAINS=example.com,.internal.local \
-e REMOTE_SOURCE_PROXY_TARGET=http://10.0.0.5:8080/remote/ \
export-api:latest
Environment Variables
| Option Name | Description | Default | Required | Example | Note |
|---|---|---|---|---|---|
PORT | Port number the server listens on | 9090 | Optional | PORT=9090 | |
EXPORTER_PATH | Exporter executable path | ./Exporter_exe | Optional | ||
WORK_ROOT | Temporary working directory | ./workspaces | Optional | ||
EXPORTER_TIMEOUT | Conversion timeout (ms) | 120000 | Optional | ||
REMOTE_SOURCE_PROXY_DOMAINS | List of domains to apply remote image proxy (comma-separated) | None | Optional | example.com,.internal.local | |
REMOTE_SOURCE_PROXY_TARGET | Proxy target base URL accessible from internal network | None | Optional | http://10.0.0.5:8080/remote/ | |
REMOTE_SOURCE_HEADERS | Custom HTTP headers to include when downloading remote images (comma-separated) | None | Optional | X-Custom-Auth:token123,X-Request-Source:exporter | v0.0.9+ |
Direct Download Failure Situations
If the server (or Docker container) cannot directly receive external images due to corporate network blocks, authentication requirements, IP/region restrictions, HTTP↔HTTPS policies, etc., that image is displayed as a broken image.
Bypassing via Proxy Settings
REMOTE_SOURCE_PROXY_DOMAINS: Specify the list of domains to apply the proxy, separated by commas. Example:.example.com,cdn.partner.com.REMOTE_SOURCE_PROXY_TARGET: Specify the proxy server address that will download the actual images instead. Example:http://proxy.internal/....
If you set these two variables, images from the specified domains will attempt to download through the proxy.
Additionally, if custom HTTP headers such as authentication are needed, specify them in REMOTE_SOURCE_HEADERS in headerName:value format. (e.g., X-Custom-Auth:my-key)
Even Then Fails
If proxy authentication failures, proxy server errors, additional permission requirements, etc. occur, the image may still not be obtained, and in this case, the final result will display the image as a broken image.
Temporary File Storage Policy
During the conversion process, all resources such as downloaded images, generated .word.pb, and output files are deleted immediately after the work is completed.
API
| Endpoint | Method | Description |
|---|---|---|
/exportFile | POST | Receives serialized document data (serializedData) and image resources from the Synap Editor, converts them into a document of a specific format (docx, hwpx, etc.) and returns the file. Supports application/json or multipart/form-data. |
/info | GET | Queries deployed server information (product name, version, Exporter version, etc.) |
/health | GET | Confirms server normal startup (health check) |
/exportFile Request Fields (multipart/form-data)
The Synap Editor client sends the following fields:
| Field Name | Type | Required | Description |
|---|---|---|---|
payload | string (JSON) | Yes | Document metadata. Includes: filename, exportType, responseType, mediaManifest |
serializedData | file/blob | Yes | Serialized document binary. Usually sent as document.bin from the client. |
media | file[] | No | Inline image Blob array. Must be in the same order as non-remote items of payload.mediaManifest. |
| Other additional fields | form field | No | User-defined parameters merged from client settings (editor.export.param) or events. |
payload JSON Structure
{
"filename": "document",
"exportType": "hwpx",
"responseType": "json",
"mediaManifest": [
{
"path": "image/image1.png",
"filename": "image1.png",
"isRemote": false,
"sourceUrl": null,
"contentType": "image/png"
},
{
"path": "https://example.com/logo.png",
"filename": "logo.png",
"isRemote": true,
"sourceUrl": "https://example.com/logo.png",
"contentType": "image/png"
}
]
}
payload Field Description
| Field Name | Type | Required | Description |
|---|---|---|---|
filename | string | No | Output filename (excluding extension). If not specified by the server, document is used. |
exportType | string | No | Conversion format. e.g.: docx, hwpx, hwp |
mediaManifest | Array<object> | No | List of images included in the document |
mediaManifest Item Description
| Field Name | Type | Required | Description |
|---|---|---|---|
path | string | No | Original path or identifier |
filename | string | No | Suggested filename for the server |
isRemote | boolean | No | If true, the server downloads from sourceUrl |
sourceUrl | string | null | Conditional | Required when isRemote: true |
contentType | string | null | No | MIME type hint (e.g., image/png) |
Processing Rules
serializedDatamust be sent as a multipart file field.- If
isRemote: trueandsourceUrlexist inmediaManifest, the server downloads the image from that URL. - If
isRemoteis not set, the server matches images sequentially from themediafile array. - Therefore, the upload order of
mediamust match the order of non-remote items inmediaManifest.