1. 渲染百度首页为PDF
请求参数:
curl --request POST 'localhost:8084/rest/pdf/render' \
--header 'Content-Type: application/json' \
-d '{
"output": "tmp/",
"fileName": "baidu",
"url": "http://www.baidu.com",
"outputType": "PDF",
"pdf": {
"pageRanges": "1",
"landscape": true,
"printBackground": true,
"preferCSSPageSize": false
}
}'
返回结果:
{
"content": "/Users/program/tal/h5-transfer-pdf/tmp/baidu.pdf",
"status": true,
"message": "render PDF success"
}
2. 渲染并打开PDF
请求参数:
http://localhost:8084/rest/pdf/show?outputType=PDF&output=tmp/&fileName=test&url=http://open.jiaoyanyun.com/#/
返回结果: