{"id":15600416,"url":"https://github.com/jason-fox/fox.jason.watermark","last_synced_at":"2026-03-18T16:55:22.232Z","repository":{"id":119826217,"uuid":"325056157","full_name":"jason-fox/fox.jason.watermark","owner":"jason-fox","description":"DITA-OT Plug-in to add a watermark to generated PDF files","archived":false,"fork":false,"pushed_at":"2024-02-18T08:04:46.000Z","size":250,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T13:27:19.881Z","etag":null,"topics":["dita-ot-plugin","pdf-document","watermark"],"latest_commit_sha":null,"homepage":"https://jason-fox.github.io/dita-ot-plugins/watermark","language":"XSLT","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jason-fox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-12-28T16:07:13.000Z","updated_at":"2023-10-04T12:37:16.000Z","dependencies_parsed_at":"2024-12-09T17:23:58.569Z","dependency_job_id":null,"html_url":"https://github.com/jason-fox/fox.jason.watermark","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"0f9d6b551188195b32063bca85991a19d367edb8"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jason-fox%2Ffox.jason.watermark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jason-fox%2Ffox.jason.watermark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jason-fox%2Ffox.jason.watermark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jason-fox%2Ffox.jason.watermark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jason-fox","download_url":"https://codeload.github.com/jason-fox/fox.jason.watermark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246182219,"owners_count":20736718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["dita-ot-plugin","pdf-document","watermark"],"created_at":"2024-10-03T02:02:49.308Z","updated_at":"2026-01-07T15:35:38.348Z","avatar_url":"https://github.com/jason-fox.png","language":"XSLT","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Watermark Plugin for DITA-OT [\u003cimg src=\"https://jason-fox.github.io/fox.jason.watermark/watermark.png\" align=\"right\" width=\"300\"\u003e](http://watermarkdita-ot.rtfd.io/)\n\n\n[![license](https://img.shields.io/github/license/jason-fox/fox.jason.watermark.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![DITA-OT 4.2](https://img.shields.io/badge/DITA--OT-4.2-green.svg)](http://www.dita-ot.org/4.2)\n[![Documentation Status](https://readthedocs.org/projects/watermarkdita-ot/badge/?version=latest)](https://watermarkdita-ot.readthedocs.io/en/latest/?badge=latest)\n\nThis is a [DITA-OT Plug-in](https://www.dita-ot.org/plugins) to add a watermark to generated PDF files. The plugin\nextends standard PDF processing. It offers an extension-point for further processing.\n\n\u003e ![](https://jason-fox.github.io/fox.jason.watermark/watermark-pdf.png)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eTable of Contents\u003c/strong\u003e\u003c/summary\u003e\n\n-   [Install](#install)\n    -   [Installing DITA-OT](#installing-dita-ot)\n    -   [Installing the Plug-in](#installing-the-plug-in)\n-   [Usage](#usage)\n    -   [Parameter Reference](#parameter-reference)\n    -   [Extension points](#extension-points)\n-   [License](#license)\n\n\u003c/details\u003e\n\n## Install\n\nThe DITA-OT Watermark plug-in has been tested against [DITA-OT 3.x](http://www.dita-ot.org/download). It is recommended that\nyou upgrade to the latest version.\n\n### Installing DITA-OT\n\n\u003ca href=\"https://www.dita-ot.org\"\u003e\u003cimg src=\"https://www.dita-ot.org/images/dita-ot-logo.svg\" align=\"right\" height=\"55\"\u003e\u003c/a\u003e\n\nThe DITA-OT Watermark plug-in is a plug-in for the DITA Open Toolkit.\n\n-   Full installation instructions for downloading DITA-OT can be found\n    [here](https://www.dita-ot.org/4.2/topics/installing-client.html).\n\n    1.  Download the `dita-ot-4.2.zip` package from the project website at\n        [dita-ot.org/download](https://www.dita-ot.org/download)\n    2.  Extract the contents of the package to the directory where you want to install DITA-OT.\n    3.  **Optional**: Add the absolute path for the `bin` directory to the _PATH_ system variable.\n\n    This defines the necessary environment variable to run the `dita` command from the command line.\n\n```console\ncurl -LO https://github.com/dita-ot/dita-ot/releases/download/4.2/dita-ot-4.2.zip\nunzip -q dita-ot-4.2.zip\nrm dita-ot-4.2.zip\n```\n\n### Installing the Plug-in\n\n-   Run the plug-in installation commands:\n\n```console\ndita install https://github.com/jason-fox/fox.jason.watermark/archive/master.zip\n```\n\nThe `dita` command line tool requires no additional configuration.\n\n---\n\n## Usage\n\nThe plugin extends standard PDF processing:\n\n```console\nPATH_TO_DITA_OT/bin/dita -f pdf -o out -i document.ditamap --pdf.watermark=draft|review|final\n```\n\nBy default the output PDF will be watermarked as a **DRAFT**\n\n### Parameter Reference\n\n-   `pdf.watermark` - Decides which watermark to use:\n    -   `draft` - Adds a watermark stating _Draft Document_\n    -   `review` - Adds a watermark stating _Copy for review only_\n    -   `final` - Adds an invisible watermark with transparent text\n    -   `none` - Does not add a watermark **DEFAULT*\n-   `pdf.watermark.width` - Width of the watermark\n-   `pdf.watermark.height` - Height of the watermark\n-   `pdf.watermark.color` - Color of the watermark\n-   `pdf.watermark.fontsize` - Override the font size of the watermark text\n-   `pdf.watermark.text1` - Override the first line of watermark text\n-   `pdf.watermark.text2` - Override the second line of watermark text\n\n### Extension points\n\nThis plug-in is designed to be extended and offers an extension point:\n\n-   `watermark.pre` - Runs an additional Ant target before the watermarking processing stage.\n\n#### Example\n\nThe following `plugin.xml` will enable the watermarking of PDF files to depend on an authorization server.\n\n##### `plugin.xml` Configuration\n\n```xml\n\u003cplugin id=\"com.example.watermark.dita\"\u003e\n  \u003crequire plugin=\"fox.jason.watermark\"/\u003e\n  \u003cfeature extension=\"watermark.pre\" value=\"watermark.auth\"/\u003e\n  \u003cfeature extension=\"depend.preprocess.pre\" value=\"watermark.check\"/\u003e\n\u003c/plugin\u003e\n```\n\n##### ANT build file\n\n```xml\n\u003cproject name=\"com.example.passthrough.dita\"\u003e\n\n  \u003cmacrodef name=\"authorize-user\"\u003e\n    \u003cattribute name=\"token\"/\u003e\n    \u003cattribute name=\"action\"/\u003e\n    \u003csequential\u003e\n      \u003c!-- do-something to authorize the action --\u003e\n      \u003cproperty if:true=\"${authorized}\" name=\"pdf.watermark\" value=\"@{value}\"/\u003e\n    \u003c/sequential\u003e\n  \u003c/macrodef\u003e\n\n  \u003ctarget name=\"watermark.check\"\u003e\n    \u003c!-- Ensure watermark isn't preset on the command line --\u003e\n    \u003cdita-ot-fail if:set=\"pdf.watermark\"/\u003e\n    \u003ccondition property=\"auth.watermark.review\"\u003e\n      \u003cequals arg1=\"${auth.level}\" arg2=\"review\"/\u003e\n    \u003c/condition\u003e\n    \u003ccondition property=\"auth.watermark.final\"\u003e\n        \u003cequals arg1=\"${auth.level}\" arg2=\"final\"/\u003e\n    \u003c/condition\u003e\n    \u003ccondition property=\"auth.watermark.none\"\u003e\n        \u003cequals arg1=\"${auth.level}\" arg2=\"none\"/\u003e\n    \u003c/condition\u003e\n  \u003c/target\u003e\n\n  \u003ctarget name=\"watermark.auth\"\u003e\n    \u003c!-- Now set watermark if authorized to do so --\u003e\n    \u003cauthorize-action if:true=\"${auth.watermark.review}\" token=\"${auth.token}\"  action=\"review\" /\u003e\n    \u003cauthorize-action if:true=\"${auth.watermark.final}\" token=\"${auth.token}\"  action=\"final\"/\u003e\n    \u003cauthorize-action if:true=\"${auth.watermark.none}\" token=\"${auth.token}\"  action=\"none\"/\u003e\n  \u003c/target\u003e\n\u003c/project\u003e\n```\n\nA working example can be found in the\n[DITA-OT Watermark Auth plug-in](https://github.com/jason-fox/fox.jason.watermark.auth) repository.\n\n## License\n\n[Apache 2.0](LICENSE) © 2021 - 2024 Jason Fox\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjason-fox%2Ffox.jason.watermark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjason-fox%2Ffox.jason.watermark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjason-fox%2Ffox.jason.watermark/lists"}