You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Document preview
CreateDocProcessJobs
Copy page
Download PDF
CreateDocProcessJobs
Description​
This interface is used to submit document transcoding tasks.​
Notes​
  • This interface is currently in invitation-only testing. Contact your account manager to use it.​
  • The source document supports doc, docx, ppt, pptx, xls, xlsx, and pdf formats.​
  • Supports document transcoding to jpg, png, and pdf formats; transcoding to html format is not supported.​
  • The target bucket for storing results must be in the same region and tenant as the source bucket.​
Request syntax​
​
POST /?doc_jobs&job_type=DocConvert HTTP/1.1​
Host: <bucket_name>.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 08:05:36 +0000​
Authorization: <authorization_string>​
Content-Type: application/json​
​
{​
"Input" : {​
"Key":"input/obj1.docx"​
},​
"DocProcessConfig" : {​
"TgtType": "jpg",​
"StartPage" : 1,​
"EndPage" : 2​
},​
"Output" : {​
"Region" : "cn-beijing",​
"Bucket" : "testbkt",​
"Object" : "async/test-{Page}.jpg"​
}​
}​
​
Request parameters and headers ​
For common request headers, see Common Parameters.​
​
Field name​
Location​
Type​
Required​
Example value​
Description​
doc_jobs​
Query​
String​
Yes​
-​
It is a unique identifier representing a submitted document transcoding task request.​
job_type​
Query​
String​
Yes​
DocConvert​
Task type, the value is DocConvert only in document transcoding scenarios.​
​
Request body elements​
​
Field name​
Type​
Required​
Example value​
Description​
Input​
Array​
Yes​
-​
File information to be processed.​
Key​
String​
Yes​
input/obj1.docx​
Complete file name including path in the storage bucket.​
Parent node: Input​
DocProcessConfig​
Array​
Yes​
-​
Specific configuration for document transcoding.​
StartPage​
Integer​
Yes​
1​
Convert starting from page X.​
In a table file, one table may be split into multiple pages for conversion, generating multiple images.​
Parent node: DocProcessConfig​
EndPage​
Integer​
Yes​
2​
Convert to page X.​
In a table file, a table may be split across multiple pages for conversion, generating multiple images. -1 means convert all pages.​
Parent node: DocProcessConfig​
SrcType​
String​
No​
-​
Source data file extension type.​
If the source type is set, the system will prioritize the set value; if not set, the source data type will be determined based on the specified object's file extension. You can set this value when the specified object has no suffix.​
Parent node: DocProcessConfig​
TgtType​
String​
No​
jpg​
convert output target file type.​
  • jpg: convert to jpg format image file; if the input format is unrecognized, jpg format is used by default.​
  • png: convert to png format image file.​
  • pdf: convert to pdf format file (page range and table SheetId selection are not supported).​
parent node: DocProcessConfig​
Output​
Array​
Yes​
-​
Specify the address information for saving the transcoded post-processing result.​
Region​
String​
Yes​
cn-beijing​
The region where the bucket is located.​
Parent node: Output​
Bucket​
String​
Yes​
testbkt​
The bucket where the results are stored.​
Parent node: Output​
Object​
String​
Yes​
abc_${Page}.jpg​
Output file path.​
  • Output file name must include the ${Page} parameter. Multiple output files, ${Page} indicates the sequence number matches the preview page number.​
  • ${Page} indicates multiple output files, with the sequence number matching the preview page number. For example, input abc_${Page}.jpg; if previewing pages 5-6 of a file, the output file names are abc_5.jpg and abc_6.jpg.​
Parent node: Output​
​
Response headers​
The response contains common headers. For more information, see Common Parameters.​
Response body elements​
​
Field name​
Type​
Example value​
Description​
Code​
String​
OK​
Error code.​
An error code is a unique string that identifies an error condition.​
Message​
String​
Success​
Detailed English description of the specific error in the error response message.​
Returned only when the task fails.​
JobId​
String​
1878c5dd2*****67f6fff7​
new task ID.​
​
Sample request​
​
POST /?doc_jobs&job_type=DocConvert HTTP/1.1​
Host: <bucket_name>.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 08:05:36 +0000​
Authorization: <authorization_string>​
Content-Type: application/json​
​
{​
"Input" : {​
"Key":"input/obj1.docx"​
},​
"DocProcessConfig" : {​
"TgtType": "jpg",​
"StartPage" : 1,​
"EndPage" : 2​
},​
"Output" : {​
"Region" : "cn-beijing",​
"Bucket" : "testbkt",​
"Object" : "async/test-{Page}.jpg"​
}​
}​
​
Sample response​
​
HTTP/1.1 200 OK​
Date: Fri, 30 Jul 2021 13:53:55 GMT​
Server: TosServer​
x-tos-id-2: 1e89f203jld00006-a444fd0​
x-tos-request-id: 1e89f203b2d00006-a444ed0​
​
{​
"Code" : "OK",​
"Message" : "Success",​
"JobId": "1878c5dd2*****67f6fff7"​
}​
​
​
Last updated: 2025.12.03 16:15:24