Documentation

Create task

A task ID is automatically generated for you based on the type of PDF tool you choose. You can provide the callback notification URL. After the task processing is completed, we will notify you of the task result through the callback interface. You can perform other operations according to the task result, such as downloading the result file.

Request method

  • request method: GET
  • parameter transfer method: Query

Request method

parameter name data type description required
executeTypeUrl String Type of execution task yes

Request address

https://api-cn-east-1.17pdf.com/server/v1/task/{executeTypeUrl}

Return parameter

parameter name data type description
taskId String task id
"code": "200",
"msg": "success",
"data": {
    "taskId": "2da9dc86-5f41-4991-b9da-bc8434f64cc5"
}

Upload file

Upload the original file and bind the file to the task ID. The field parameter is used to pass the JSON string to set the processing parameters for the file. Each file will generate automatically a unique filekey.

Request method

  • request method: POST
  • parameter transfer method: Body (form-data)

Request parameter

parameter name data type description required
file File uploaded file yes
taskId String task id yes
password String password no
parameter String file processing parameters no

The parameter field only sets the processing parameters for the currently supported functions. If no parameters are set, the default value is used. The JSON format and field explanation corresponding to different function types:

PDF to Excel:

{
    "contentOptions": "2",
    "worksheetOptions": "1"
}

contentOptions: Options to extract content(1:OnlyText、2:OnlyTable、3:AllContent)

worksheetOptions: Options to create Worksheet(1:ForEachTable、2:ForEachPage、3:ForTheDocument)

PDF to HTML:

{
    "pageOptions": "2"
}

pageOptions: 1:SinglePage、2:SinglePageNavigationByBookmarks、3:MultiplePages、4:MultiplePagesSplitByBookmarks

PDF split:

{
     "pageOptions": "['1-3','4','5-6']"
}

pageOptions: A collection of page numbers, page numbers start from 1, for example: 2-4 1,2,3 1-3,5 (this example is divided into 3 files, separated by spaces)

PDF merge:

{
    "pageOptions": "['1,2']"
}

pageOptions: The page range of the merged document, the page number starts from 1, for example: 1,2,4,6,9-11 (default all pages are not entered, the entered page number cannot exceed the maximum page number of the document)

Request address

https://api-cn-east-1.17pdf.com/server/v1/file/upload

Return parameter

parameter name data type description
fileKey String file unique identification
fileUrl String file storage path
"code": "200",
"msg": "success",
"data": {
    "fileKey": "c6e0dcde-7533-4058-81fb-ea2a26677f85",
    "fileUrl": "https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/***.pdf"
}

Perform tasks

After the file upload is completed, call this interface with the task ID to process file.

Request method

  • request method: GET
  • parameter transfer method: Query

Request parameter

parameter name data type description required
taskId String task id yes

Request address

https://api-cn-east-1.17pdf.com/server/v1/execute/start?taskId='135e8570-6377-4660-94d2-867952796f2c'

Return parameter

parameter name data type description
taskId String task id
"code": "200",
"msg": "success",
"data": {
    "taskId": "135e8570-6377-4660-94d2-867952796f2c"
}

Download files

Get the download link of the corresponding result file according to the filekey of each file.

Request method

  • request method: GET
  • parameter transfer method: Query

Request parameter

parameter name data type description required
fileKey String file unique identification yes

Request address

https://api-cn-east-1.17pdf.com/server/v1/file/fileInfo?fileKey='c6e0dcde-7533-4058-81fb-ea2a26677f85'

Return parameter

parameter name data type description
fileKey String file unique identification
taskId String task id
fileName String original file name
downFileName String down File Name
fileUrl String original file address
downloadUrl String transfer download address
sourceType String source file format
targetType String target file format
fileSize Long file size
convertSize Long convert success size
convertTime Long conversion time
status String File Conversion Status
failureCode String failure reason code
failureReason String failure reason
fileParameter String file processing parameters
"code": "200",
"msg": "success",
"data": {
    "fileKey": "ba13a2a8-1278-43d4-a9a6-7ecc28a0804f",
    "taskId": "f416dbcf-0c10-4f93-ab9e-a835c1f5dba1",
    "fileName": "test.pdf",
    "downFileName": "test.docx",
    "fileUrl": "https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/test.pdf",
    "downloadUrl": "https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/test.docx",
    "sourceType": "pdf",
    "targetType": "docx",
    "fileSize": 24475,
    "convertSize": 6922,
    "convertTime": 8,
    "status": "success",
    "failureCode": "",
    "failureReason": "",
    "fileParameter": "{    \"pageOptions\": \"3\"}"
}

Note:

status :File Conversion Status

status description
created File upload succeeded
processing File conversion in progress
success File conversion succeeded
failed File conversion failed
overdue File saving expired, file deletion