Document preview
Overview
The document preview feature, powered by Baidu AI Cloud Document Service (DOC), enables developers to store, manage, and view various document formats such as Office and WPS online. Without requiring technical knowledge of document storage, transcoding, distribution, or online viewing, you can quickly construct a secure, reliable, and highly customizable document processing platform and applications, aiding in the digital transformation of industries like online education and enterprise file management systems.
- Support for multiple formats
Source documents can be in multiple formats, including doc, docx, ppt, pptx, xls, xlsx, vsd, pot, pps, rtf, wps, et, dps, pdf, txt, and epub.
- File size limit
File previews are not supported for files larger than 200 MB.
- File page limit
File previews are not supported for files exceeding 200 pages.
Charge type
The document preview service will officially start charging at 00:00 on September 23, 2022. You can sign in to the Console - Finance to view usage data. BOS fees are billed hourly. For specific prices, refer to Data Processing Fees.
Usage method
Request parameters
Operation name: doc/preview
| Parameter | Values | Description |
|---|---|---|
| tt | h5, image |
|
| st | doc, docx, ppt, pptx, xls, xlsx, vsd, pot, pps, rtf, wps, et, dps, pdf, txt and epub |
|
| p | 1-200 |
|
Request example
1GET https://bj.bcebos.com/bucket/object.pdf?x-bce-process=doc/preview,tt_image,p_1
1GET https://bj.bcebos.com/bucket/object.pdf?x-bce-process=doc/preview,tt_h5
1GET https://bj.bcebos.com/bucket/object?x-bce-process=doc/preview,tt_h5,st_doc
Request flow
- The client application or web terminal initiates a preview request to the application server and provides the file name to be previewed.
- The application server generates a signed URL based on the requested file and provides it to the client application or web terminal.
- The client application or web terminal uses the signed URL to directly access and preview the BOS file.
