Skip to main content

PDF水印服务

PDF水印服务 文件流越大响应时间会相对增长 请延长请求时间 相同文件不会进行二次下载 建议客户端对字典及文件名进行哈希 相同进行缓存

项目地址

http://git.dev.jiweinet.com/back-end/pdf-watermark.git

服务地址

httphttps
线下+生产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

ParameterDescriptionTypeRequiredExplain
source请求来源stringmp、pc
model水印模式stringdiy 使用字典时必填
filePath文件地址string
dictionary字典objects文件会根据水印字典对文件进行水印操作 详见下方说明
settings配置objects水印通过配置生产 不传则使用默认配置

dictionary

["zhusj"] #增加单个水印
["zhusij","18434819907"] #增加多个水印
["zhusij","18434819907","ijiwei"] #增加N个水印

settings

ParameterDescriptionTypeRequiredExplain
rotate_angle水印倾斜度int默认:45
text_rgb水印颜色int默认:211-灰
font_size字体大小int默认:18

Response Data

TitleDescriptionTypeRequiredTips
status状态:0失败 1成功integer
msgstatus非1时,返回错误信息 status为1时返回文件地址string

Error

{
"code": 0,
"msg": "文件地址有误"
}