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 NameDescriptionDefaultRequiredExampleNote
PORTPort number the server listens on9090OptionalPORT=9090
EXPORTER_PATHExporter executable path./Exporter_exeOptional
WORK_ROOTTemporary working directory./workspacesOptional
EXPORTER_TIMEOUTConversion timeout (ms)120000Optional
REMOTE_SOURCE_PROXY_DOMAINSList of domains to apply remote image proxy (comma-separated)NoneOptionalexample.com,.internal.local
REMOTE_SOURCE_PROXY_TARGETProxy target base URL accessible from internal networkNoneOptionalhttp://10.0.0.5:8080/remote/
REMOTE_SOURCE_HEADERSCustom HTTP headers to include when downloading remote images (comma-separated)NoneOptionalX-Custom-Auth:token123,X-Request-Source:exporterv0.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

EndpointMethodDescription
/exportFilePOSTReceives 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.
/infoGETQueries deployed server information (product name, version, Exporter version, etc.)
/healthGETConfirms server normal startup (health check)

/exportFile Request Fields (multipart/form-data)

The Synap Editor client sends the following fields:

Field NameTypeRequiredDescription
payloadstring (JSON)YesDocument metadata. Includes: filename, exportType, responseType, mediaManifest
serializedDatafile/blobYesSerialized document binary. Usually sent as document.bin from the client.
mediafile[]NoInline image Blob array. Must be in the same order as non-remote items of payload.mediaManifest.
Other additional fieldsform fieldNoUser-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 NameTypeRequiredDescription
filenamestringNoOutput filename (excluding extension). If not specified by the server, document is used.
exportTypestringNoConversion format. e.g.: docx, hwpx, hwp
mediaManifestArray<object>NoList of images included in the document

mediaManifest Item Description

Field NameTypeRequiredDescription
pathstringNoOriginal path or identifier
filenamestringNoSuggested filename for the server
isRemotebooleanNoIf true, the server downloads from sourceUrl
sourceUrlstring | nullConditionalRequired when isRemote: true
contentTypestring | nullNoMIME type hint (e.g., image/png)

Processing Rules

  • serializedData must be sent as a multipart file field.
  • If isRemote: true and sourceUrl exist in mediaManifest, the server downloads the image from that URL.
  • If isRemote is not set, the server matches images sequentially from the media file array.
  • Therefore, the upload order of media must match the order of non-remote items in mediaManifest.

Related Features