Skip to content

PDF 生成模板编辑器

开源可视化 PDF 生成引擎,支持自定义模板,并提供面向开发者的 API,灵活构建文档生成流程。

查看 GitHub

获取任务列表 ​

查询当前用户的文件处理任务列表。可通过分页参数浏览历史任务,并查看任务状态、费用、源文件类型、目标文件类型等任务级元数据。

请求方法 ​

  • 请求方法:GET
  • 参数传递方式:Query

请求参数 ​

参数数据类型说明必填项
pageLong当前页数否(不填默认为 1)
sizeLong每页显示项数否(不填默认为 10)

请求地址 ​

https://api-server.compdf.com/server/v2/task/list

返回参数 ​

参数数据类型说明
recordsArray当前页任务记录
totalLong总记录数
sizeLong每页显示项数
currentLong当前页数
pagesLong总页数
createdByString创建者
updatedByString更新者
creationTimeLocalDateTime创建时间
updateTimeLocalDateTime更新时间
idLong任务主键 ID
taskIdString任务 ID
taskUrlString任务原始文件夹
taskLoadUrlString任务转换文件夹
taskFileNumInteger任务文件数
taskSuccessNumInteger成功文件数
taskFailNumInteger失败文件数
taskStatusString任务状态
assetTypeIdInteger使用资产类型
taskCostInteger任务成本
taskTimeLong任务持续时间
callbackUrlString回调地址
serverString服务器地址
sourceTypeString源文件格式
targetTypeString目标文件格式
tenantIdLong租户 ID

返回示例 ​

json
{
  "records": [
    {
      "createdBy": null,
      "updatedBy": null,
      "creationTime": "2022-08-31 15:06:20",
      "updateTime": "2022-08-31 15:14:44",
      "id": 771751854513061888,
      "taskId": "a300c232-0a2d-4e3c-95f2-cfb4604b2018",
      "taskUrl": "",
      "taskLoadUrl": "",
      "taskFileNum": 3,
      "taskSuccessNum": 0,
      "taskFailNum": 0,
      "taskStatus": "TaskFinish",
      "assetTypeId": 0,
      "taskCost": 3,
      "taskTime": 0,
      "callbackUrl": "",
      "server": "",
      "sourceType": "pdf",
      "targetType": "docx",
      "tenantId": 1
    },
    {
      "createdBy": null,
      "updatedBy": null,
      "creationTime": "2022-08-31 15:25:24",
      "updateTime": "2022-08-31 15:26:17",
      "id": 771756653954465793,
      "taskId": "e74d60a6-fbd3-4d7d-9efa-0dc70297ee0b",
      "taskUrl": "",
      "taskLoadUrl": "",
      "taskFileNum": 3,
      "taskSuccessNum": 3,
      "taskFailNum": 0,
      "taskStatus": "TaskFinish",
      "assetTypeId": 0,
      "taskCost": 3,
      "taskTime": 3,
      "callbackUrl": "",
      "server": "",
      "sourceType": "pdf",
      "targetType": "docx",
      "tenantId": 1
    }
  ],
  "total": 528,
  "size": 2,
  "current": 1,
  "orders": [],
  "optimizeCountSql": true,
  "searchCount": true,
  "countId": null,
  "maxLimit": null,
  "pages": 264
}

任务状态 ​

状态内容状态描述
TaskStart任务创建成功
TaskWaiting任务等待处理
TaskProcessing任务开始处理中
TaskFinish任务处理完成
TaskOverdue任务等待处理超时