Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jason-fox/fox.jason.watermark

DITA-OT Plug-in to add a watermark to generated PDF files
https://github.com/jason-fox/fox.jason.watermark

dita-ot-plugin pdf-document watermark

Last synced: 25 days ago
JSON representation

DITA-OT Plug-in to add a watermark to generated PDF files

Awesome Lists containing this project

README

        

# Watermark Plugin for DITA-OT [](http://watermarkdita-ot.rtfd.io/)

[![license](https://img.shields.io/github/license/jason-fox/fox.jason.watermark.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![DITA-OT 4.2](https://img.shields.io/badge/DITA--OT-4.2-green.svg)](http://www.dita-ot.org/4.2)
[![Documentation Status](https://readthedocs.org/projects/watermarkdita-ot/badge/?version=latest)](https://watermarkdita-ot.readthedocs.io/en/latest/?badge=latest)

This is a [DITA-OT Plug-in](https://www.dita-ot.org/plugins) to add a watermark to generated PDF files. The plugin
extends standard PDF processing. It offers an extension-point for further processing.

> ![](https://jason-fox.github.io/fox.jason.watermark/watermark-pdf.png)

Table of Contents

- [Install](#install)
- [Installing DITA-OT](#installing-dita-ot)
- [Installing the Plug-in](#installing-the-plug-in)
- [Usage](#usage)
- [Parameter Reference](#parameter-reference)
- [Extension points](#extension-points)
- [License](#license)

## Install

The DITA-OT Watermark plug-in has been tested against [DITA-OT 3.x](http://www.dita-ot.org/download). It is recommended that
you upgrade to the latest version.

### Installing DITA-OT

The DITA-OT Watermark plug-in is a plug-in for the DITA Open Toolkit.

- Full installation instructions for downloading DITA-OT can be found
[here](https://www.dita-ot.org/4.2/topics/installing-client.html).

1. Download the `dita-ot-4.2.zip` package from the project website at
[dita-ot.org/download](https://www.dita-ot.org/download)
2. Extract the contents of the package to the directory where you want to install DITA-OT.
3. **Optional**: Add the absolute path for the `bin` directory to the _PATH_ system variable.

This defines the necessary environment variable to run the `dita` command from the command line.

```console
curl -LO https://github.com/dita-ot/dita-ot/releases/download/4.2/dita-ot-4.2.zip
unzip -q dita-ot-4.2.zip
rm dita-ot-4.2.zip
```

### Installing the Plug-in

- Run the plug-in installation commands:

```console
dita install https://github.com/jason-fox/fox.jason.watermark/archive/master.zip
```

The `dita` command line tool requires no additional configuration.

---

## Usage

The plugin extends standard PDF processing:

```console
PATH_TO_DITA_OT/bin/dita -f pdf -o out -i document.ditamap --pdf.watermark=draft|review|final
```

By default the output PDF will be watermarked as a **DRAFT**

### Parameter Reference

- `pdf.watermark` - Decides which watermark to use:
- `draft` - Adds a watermark stating _Draft Document_
- `review` - Adds a watermark stating _Copy for review only_
- `final` - Adds an invisible watermark with transparent text
- `none` - Does not add a watermark **DEFAULT*
- `pdf.watermark.width` - Width of the watermark
- `pdf.watermark.height` - Height of the watermark
- `pdf.watermark.color` - Color of the watermark
- `pdf.watermark.fontsize` - Override the font size of the watermark text
- `pdf.watermark.text1` - Override the first line of watermark text
- `pdf.watermark.text2` - Override the second line of watermark text

### Extension points

This plug-in is designed to be extended and offers an extension point:

- `watermark.pre` - Runs an additional Ant target before the watermarking processing stage.

#### Example

The following `plugin.xml` will enable the watermarking of PDF files to depend on an authorization server.

##### `plugin.xml` Configuration

```xml



```

##### ANT build file

```xml

























```

A working example can be found in the
[DITA-OT Watermark Auth plug-in](https://github.com/jason-fox/fox.jason.watermark.auth) repository.

## License

[Apache 2.0](LICENSE) © 2021 - 2024 Jason Fox