Format Conversion
💡 Calling API requires authentication. Authentication reference: Interface Authentication
POST {apiPrefix}/convert
Submit conversion task
- If task addition fails, failure reason is returned synchronously
- If task addition succeeds, task ID is returned synchronously. Third parties can configure task callback notifications to get task status.
Request Body
Content-Type is application/json
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| fileUrl | string | File download address | Yes |
| filename | string | File name including extension | Yes |
| targetFilename | string | Target file name including extension | Yes |
| tokenType | string | Third-party token type, value is cookie or header | No |
| tokenValue | string | Third-party token value, passed back when zOffice downloads files or callback notifications | No |
| callback | string | Callback address. zOffice calls back to notify status after task conversion is complete | Yes |
| uniqueId | string | Unique identifier for file content | No |
| tiledWatermark | TiledWatermark | Tiled watermark configuration. Currently only supports doc/docx/wps/dot/wpt/dotx/docm/dotm/ppt/pps/dps/pot/pptx/pptm/potx/ppsx/ppsm/potm exported to pdf, only supports text watermark | No |
| msPicWatermark | MsPicWatermark | Position image watermark Currently only supports docx/wps/doc exported to pdf | No |
| excel2pdfOptions | Excel2PdfOptions | Excel to PDF options. Only effective when xls/xlsx/et exported to PDF | No |
| toPicOptions | toPicOptions | PDF/Word to image options. Only effective when pdf/word exported to images | No |
- fileUrl/tokenType/tokenValue/callback description see Common Field Description in this document
- When PDF is exported to images, if long images are concatenated, the downloaded file is image type; if long images are not concatenated, the downloaded file is zip format compressed package
Conversion Type Support and Limitations
| Source File Type | Target File Type | Limitations |
|---|---|---|
| doc/docx/wps/dot/wpt/dotx/docm/dotm | Source file max 300M, docx format 600M. Max 1000 pages | |
| xls/xlsx/et/ett/xlt/xltx/xlsm/xltm/xlsb | Source file max 300M, xlsx format 600M. Max export 200 pages | |
| jpg/jpeg/png/bmp | Source file max 200M, total pages max 50 pages | |
| ppt/pps/dps/pot/pptx/pptm/potx/ppsx/ppsm/potm | Source file max 50M | |
| doc/docx/wps/dot/wpt/dotx/docm/dotm | ofd | Source file max 50M, total pages max 100 pages |
| doc/docx/wps/dot/wpt/dotx/docm/dotm | jpg/jpeg/png | Source file max 300M, docx format 600M. Max 1000 pages |
| ofd | Source file max 50M, total pages max 100 pages | |
| ofd | Source file max 50M | |
| html | pdf/docx | Source file max 5M |
Normal Response:
{
"taskId": "6f6598c8-c87e-420b-b6c4-6f1b187201dc",
"code": "Ok",
"detail": {
"taskStatus": "IN_QUEUE"
}
}
Error Response:
{
"taskId": "695fbf6e-90d2-42ba-83d5-00e81e5e366e",
"code": "TaskQueueCongestion",
"detail": {
"taskStatus": "FAIL"
}
}