PDF水印服务
PDF水印服务 文件流越大响应时间会相对增长 请延长请求时间 相同文件不会进行二次下载 建议客户端对字典及文件名进行哈希 相同进行缓存
项目地址
http://git.dev.jiweinet.com/back-end/pdf-watermark.git
服务地址
http | https | |
---|---|---|
线下+生产 | http://120.25.235.220:9487 |
请求方式
POST
/service/Run.php
CURL
curl --location 'http://localhost:9487/service/Run.php' \ --form 'source="mp"' \ --form 'model="diy"' \ --form 'filePath="https://s.laoyaoba.com/jiWei/template/pdf/test.pdf"' \ --form 'dictionary="[\"朱思嘉\",\"2023-05-23\",\"爱集微有限公司\"]"' \ --form 'settings="{\"rotate_angle\":60,\"text_rgb\":240,\"font_size\":30}"'
Response Body :
{
"code": 0,
"msg": "https://s.laoyaoba.com/jiWei/waterPdf/1716449725614.pdf"
}
Request Parameters FORM-DATA
Parameter | Description | Type | Required | Explain |
---|---|---|---|---|
source | 请求来源 | string | 是 | mp、pc |
model | 水印模式 | string | 否 | diy 使用字典时必填 |
filePath | 文件地址 | string | 是 | |
dictionary | 字典 | objects | 是 | 文件会根据水印字典对文件进行水印操作 详见下方说明 |
settings | 配置 | objects | 否 | 水印通过配置生产 不传则使用默认配置 |
dictionary
["zhusj"] #增加单个水印
["zhusij","18434819907"] #增加多个水印
["zhusij","18434819907","ijiwei"] #增加N个水印
settings
Parameter | Description | Type | Required | Explain |
---|---|---|---|---|
rotate_angle | 水印倾斜度 | int | 否 | 默认:45 |
text_rgb | 水印颜色 | int | 否 | 默认:211-灰 |
font_size | 字体大小 | int | 否 | 默认:18 |
Response Data
Title | Description | Type | Required | Tips |
---|---|---|---|---|
status | 状态:0失败 1成功 | integer | 是 | |
msg | status非1时,返回错误信息 status为1时返回文件地址 | string | 是 |
Error
{
"code": 0,
"msg": "文件地址有误"
}