文档智能预览
通过接口将Word、Excel、PDF、XLSX文档转为HTML或图片
接口介绍
功能简介
文档智能预览 是本地文件转换能力,有文本层时生成 HTML 预览,无文本层时转换为图片预览。
适用场景
- 文件格式转换
- 在线预览生成
- 文档内容提取
- 自动化文件处理
功能特性
- 本地 AIGCPanel Worker 执行
- 异步任务提交与轮询查询
- 返回结果文件链接
- 不依赖阿里云 DocMind 等第三方文档转换服务
| 接口计费 | VIP特权 |
|---|---|
|
1,000 页
/
¥4.90
10,000 页
/
¥49.00
100,000 页
/
¥460.00
|
暂无VIP特权
|
接口文档
1. 接口基础
使用前请阅读 接口基础 。
2. 转换接口(异步)
请求地址
[POST] https://api.tecmz.com/open_api/doc_smart_preview/queue
请求参数
| 参数 | 必须 | 类型 | 说明 |
|---|---|---|---|
| url | 是 | string | 文件 HTTP 地址,必须外网可访问;示例:https://example.com/file.pdf |
| name | 否 | string | 结果文件名称,最长 200 字符。 |
| param | 否 | string | JSON 字符串参数,示例:{"limit":100} |
返回
{
"code": 0,
"msg": "ok",
"data": {
"jobId": 1
}
}
3. 转换查询
建议 5 到 10 秒查询一次转换结果。
请求地址
[POST] https://api.tecmz.com/open_api/doc_smart_preview/query
请求参数
| 参数 | 必须 | 类型 | 说明 |
|---|---|---|---|
| jobId | 是 | integer | 转换任务 ID。 |
返回
{
"code": 0,
"msg": "ok",
"data": {
"status": "SUCCESS",
"urls": ["https://example.com/css-all.css","https://example.com/html-1.html"],
"param": {"type":"html","cssSize":1024,"htmlSize":2048,"htmlCount":1,"pageCount":3}
}
}