跳到主要内容

PDF旋转

说明

  • 将1个PDF文件旋转,度数值可选-270、-180、-90、90、180、270度
  • 1个PDF文件指定的页数旋转

接口说明

请求地址

request_url 参考基础 > request_url

请求参数,POST请求

名称类型必须描述
methodStringpdf.rotate,固定值
tokenString可自行创建或更新,参考基础 > token
asyncString任务方式,默认0,代表同步;1代表异步,异步需要设置回调地址,或者主动查询结果
inputString输入文件,可访问互联网url,比如 https://static.easyyun.com/static/example/files/one_page.pdf
optionsStringjson格式,比如{"rotation": "90","pages":"1,2"}

options字段说明

  • rotation 必须,旋转度数,值可选-270、-180、-90、90、180、270度,
  • pages 非必须,指定页数,如"1",第1页旋转;如"1,2",第1和2页旋转。如果为空,或者无此字段,代表整个文件旋转。

响应参数,类型为JSON

名称类型示例值描述
request_idStringxxx任务id
codeString200code说明
dataString{"file_url": "xxx"}json格式消息内容
code_msgString"成功"code描述

请求示例

curl -X POST 'https://test-rest-api.easyyun.com/v1/router/rest' \
-d 'method=pdf.rotate' \
-d 'token=395a25d6fa758bfb6c0d3da007a8b189' \
-d 'input=https://static.easyyun.com/static/example/files/one_page.pdf' \
-d 'options={"rotation": "90"}'

响应示例

{
"request_id": "xxx",
"code": "200",
"data": {
"file_url": "https://static.easyyun.com/static/example/out/rotation_90.pdf"
},
"code_msg": "请求成功"
}