{"id":43543334,"url":"https://github.com/devsapp/start-pdf-watermark","last_synced_at":"2026-02-03T18:37:55.192Z","repository":{"id":103358077,"uuid":"502799524","full_name":"devsapp/start-pdf-watermark","owner":"devsapp","description":"pdf add watermark","archived":false,"fork":false,"pushed_at":"2024-12-27T06:54:22.000Z","size":7409,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-12-27T07:29:54.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devsapp.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-13T04:00:56.000Z","updated_at":"2024-04-24T16:25:47.000Z","dependencies_parsed_at":"2024-03-04T11:29:16.965Z","dependency_job_id":"82bce361-6859-4f12-a64a-d4d4ba7ea0fd","html_url":"https://github.com/devsapp/start-pdf-watermark","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/devsapp/start-pdf-watermark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fstart-pdf-watermark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fstart-pdf-watermark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fstart-pdf-watermark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fstart-pdf-watermark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devsapp","download_url":"https://codeload.github.com/devsapp/start-pdf-watermark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fstart-pdf-watermark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29052640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-03T18:37:53.282Z","updated_at":"2026-02-03T18:37:55.180Z","avatar_url":"https://github.com/devsapp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# start-pdf-watermark 帮助文档\n\n\u003cp align=\"center\" class=\"flex justify-center\"\u003e\n    \u003ca href=\"https://www.serverless-devs.com\" class=\"ml-1\"\u003e\n    \u003cimg src=\"http://editor.devsapp.cn/icon?package=start-pdf-watermark\u0026type=packageType\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://www.devsapp.cn/details.html?name=start-pdf-watermark\" class=\"ml-1\"\u003e\n    \u003cimg src=\"http://editor.devsapp.cn/icon?package=start-pdf-watermark\u0026type=packageVersion\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://www.devsapp.cn/details.html?name=start-pdf-watermark\" class=\"ml-1\"\u003e\n    \u003cimg src=\"http://editor.devsapp.cn/icon?package=start-pdf-watermark\u0026type=packageDownload\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdescription\u003e\n\n\u003e ***快速部署一个pdf添加水印的应用到阿里云函数计算***\n\n\u003c/description\u003e\n\n\u003ctable\u003e\n\u003c/table\u003e\n\n\u003ccodepre id=\"codepre\"\u003e\n\u003c/codepre\u003e\n\n\u003cdeploy\u003e\n\n## 部署 \u0026 体验\n\n\u003cappcenter\u003e\n\n-  :fire:  通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-pdf-watermark) ，\n[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-pdf-watermark)  该应用。 \n\n\u003c/appcenter\u003e\n\n- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署：\n    - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ，并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ；\n    - 初始化项目：`s init start-pdf-watermark -d start-pdf-watermark`   \n    - 进入项目，并进行项目部署：`cd start-pdf-watermark \u0026\u0026 s deploy -y`\n\n\u003c/deploy\u003e\n\n\u003cappdetail id=\"flushContent\"\u003e\n\n# 应用详情\n\n项目部署完成，可以通过`invoke`命令进行触发/测试, 有如下相关的参数：\n\n```\n{\n    \"pdf_file\": \"example.pdf\",  \n    \"mark_text\": \"AliyunFC\",  // 水印文字， 如果给 PDF 加水印，该参数必填\n    \"pagesize\": [595.275590551181, 841.8897637795275], // 可选参数，默认是 A4 大小， (21*cm, 29.7*cm), 其中 1cm=28.346456692913385\n    \"font\": \"Helvetica\", // 字体，可选参数， 默认为 Helvetica,  中文字体可选择为 zenhei 或 microhei\n    \"font_size\": 30, // 字体d大小，可选参数， 默认为 30\n    \"font_color\": [0, 0, 0], // 字体颜色，格式为 RGB， 默认为黑色\n    \"rotate\": 30, // 旋转角度, 可选参数， 默认为 0\n    \"opacity\": 0.1, // 透明度, 可选参数， 默认为 0.1， 1 表示不透明\n    \"density\": [198.4251968503937, 283.46456692913387] // 水印密度，水印文字间隔，默认是 [141.73228346456693, 141.73228346456693]，即（7*cm, 10*cm),  表示每个水印文字在横坐标和纵坐标的间隔分别是 7cm 和 10\n}\n```\n\n函数调用成功后，生成的 pdf 文件在和输入的 pdf 文件在相同的 OSS 目录中，比如这个例子是在 example_out.pdf。\n\n比如:\n```bash\n$ s invoke -e '{\"pdf_file\":\"example.pdf\", \"mark_text\": \"AliyunFC\", \"rotate\":30}'\n\n# 如果是中文水印, font 为 zenhei 或者 microhei\n$ s invoke -e '{\"pdf_file\":\"example.pdf\", \"mark_text\": \"函数计算\", \"rotate\":30, \"font\": \"zenhei\"}'\n```\n\n生成带有水印的 example_out.pdf 示例:\n\n![](https://img.alicdn.com/imgextra/i1/O1CN01Tu6Ovz1gT5GcXhfm0_!!6000000004142-2-tps-647-842.png)\n\n# 其他\n如果进行二次开发， 有新的依赖 python lib, 可以直接使用如下命令：\n\n```bash\n$ s build --use-sandbox\n# 进入 sandbox 后\n$ s-install pip install xxx\n\n# exit 退出， 然后重新 s deploy 即可\n```\n\n\u003c/appdetail\u003e\n\n\u003cdevgroup\u003e\n\n## 开发者社区\n\n您如果有关于错误的反馈或者未来的期待，您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态，您可以通过以下渠道进行：\n\n\u003cp align=\"center\"\u003e\n\n| \u003cimg src=\"https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407298906_20211028074819117230.png\" width=\"130px\" \u003e | \u003cimg src=\"https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407044136_20211028074404326599.png\" width=\"130px\" \u003e | \u003cimg src=\"https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407252200_20211028074732517533.png\" width=\"130px\" \u003e |\n|--- | --- | --- |\n| \u003ccenter\u003e微信公众号：`serverless`\u003c/center\u003e | \u003ccenter\u003e微信小助手：`xiaojiangwh`\u003c/center\u003e | \u003ccenter\u003e钉钉交流群：`33947367`\u003c/center\u003e | \n\n\u003c/p\u003e\n\n\u003c/devgroup\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsapp%2Fstart-pdf-watermark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevsapp%2Fstart-pdf-watermark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsapp%2Fstart-pdf-watermark/lists"}