Skip to main content

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 NameTypeDescriptionRequired
fileUrlstringFile download addressYes
filenamestringFile name including extensionYes
targetFilenamestringTarget file name including extensionYes
tokenTypestringThird-party token type, value is cookie or headerNo
tokenValuestringThird-party token value, passed back when zOffice downloads files or callback notificationsNo
callbackstringCallback address. zOffice calls back to notify status after task conversion is completeYes
uniqueIdstringUnique identifier for file contentNo
tiledWatermarkTiledWatermarkTiled 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 watermarkNo
msPicWatermarkMsPicWatermarkPosition image watermark Currently only supports docx/wps/doc exported to pdfNo
excel2pdfOptionsExcel2PdfOptionsExcel to PDF options. Only effective when xls/xlsx/et exported to PDFNo
toPicOptionstoPicOptionsPDF/Word to image options. Only effective when pdf/word exported to imagesNo
  • 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 TypeTarget File TypeLimitations
doc/docx/wps/dot/wpt/dotx/docm/dotmpdfSource file max 300M, docx format 600M. Max 1000 pages
xls/xlsx/et/ett/xlt/xltx/xlsm/xltm/xlsbpdfSource file max 300M, xlsx format 600M. Max export 200 pages
pdfjpg/jpeg/png/bmpSource file max 200M, total pages max 50 pages
ppt/pps/dps/pot/pptx/pptm/potx/ppsx/ppsm/potmpdfSource file max 50M
doc/docx/wps/dot/wpt/dotx/docm/dotmofdSource file max 50M, total pages max 100 pages
doc/docx/wps/dot/wpt/dotx/docm/dotmjpg/jpeg/pngSource file max 300M, docx format 600M. Max 1000 pages
pdfofdSource file max 50M, total pages max 100 pages
ofdpdfSource file max 50M
htmlpdf/docxSource 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"
}
}