Skip to main content

Watermarks

Since 2026.5.0, ARender Horizon watermarks the documents a user views, downloads or prints when the user is not cleared to get them clean. The watermark is drawn by the broker into the content it serves. A user who is not cleared is never served the clean copy, whichever client asks.

Three watermarks, three clearances​

Each action has its own watermark, and its own clearance in the permission policy:

ActionWatermark applied withoutBuilt-in text
ViewVIEW_UNMARKEDViewed by {user.name} at {date.now#yyyy/MM/dd HH:mm}
DownloadDOWNLOAD_UNMARKEDDownloaded by {user.name} at {date.now#yyyy/MM/dd HH:mm:ss}
PrintPRINT_UNMARKEDPrinted by {user.name} at {date.now#yyyy/MM/dd HH:mm:ss}

The clearances alone decide who gets a watermark. The shipped policies of the Alfresco, FileNet and M-Files providers grant the three clearances to every user, so nothing is watermarked out of the box.

To watermark a user's view, remove VIEW_UNMARKED from what the policy grants them. For example, to watermark every view but let a group of users download and print without watermarks:

application.yml (provider)
arender:
permissions:
policy:
defaults:
- DOCUMENT_READ
- DOWNLOAD
- DOWNLOAD_RENDERED
- PRINT
- ANNOTATION_READ
rules:
- name: compliance officers get clean copies
when:
groups: [GROUP_compliance]
grant: [DOWNLOAD_UNMARKED, PRINT_UNMARKED]

What is watermarked​

Content requestedWithout the clearance
Page images and thumbnailsDrawn with the view watermark.
Printed documentA PDF with the print watermark.
Download as PDFA PDF with the download watermark.
Download of the source file, when the source is a PDFA PDF with the download watermark.
Download of a source file in another format, an archive, or a format other than PDFRefused (403): these formats cannot carry a watermark.
Text, search resultsUnchanged: the watermark is not part of the text.

The results of a comparison or a transformation are watermarked the same way when they are downloaded or printed.

The download and print copies are built for each request, so their date is to the second. The view copy is built once per viewing session.

In the spreadsheet data view, Horizon draws the view watermark over the grid. It asks the broker for it each time the data view shows, so the user name and date are current.

Configuring the watermarks​

The watermarks are set in the provider configuration, under arender.watermarks. Each watermark starts from its built-in value: set only the keys you change.

application.yml (provider)
arender:
watermarks:
view:
text: "Confidential - {user.name}"
placement: TILED
color: "#B00020"
download:
text: "Downloaded by {user.name} on {date.now#dd/MM/yyyy}"
KeyDescription
arender.watermarks.<action>.textThe text of the watermark. It may hold the placeholders.
arender.watermarks.<action>.placementCENTER, TOP_LEFT or TILED. See Placement.
arender.watermarks.<action>.font-sizeFont size in points, for an A4 page width. It is scaled to the width of each page.
arender.watermarks.<action>.rotationRotation in degrees, clockwise.
arender.watermarks.<action>.colorText color, as #RRGGBB.
arender.watermarks.<action>.opacityOpacity, greater than 0 and at most 1. Defaults to 0.5, or 0.2 when the placement is TILED.

<action> is view, download or print. The built-in values are:

ActionPlacementFont sizeRotationColor
ViewTILED14330#455A64
DownloadCENTER30315#B00020
PrintTOP_LEFT100#455A64

The watermarks are read once at startup, and apply to every document and every user of the provider. A successful load is logged as:

Loaded watermarks: view '…', download '…', print '…'

A watermark that cannot be drawn makes the provider fail at startup, with a message naming the key, for example:

arender.watermarks.view: Watermark color must be #RRGGBB: red

The same keys can be set as environment variables, such as ARENDER_WATERMARKS_VIEW_TEXT.

Placeholders​

PlaceholderReplaced with
{user.name}The name of the authenticated user. It is Unknown when the broker has no authenticated user: see Security.
{date.now#<pattern>}The current date and time on the broker, formatted with a Java DateTimeFormatter pattern, such as {date.now#dd/MM/yyyy}.
{date.now}The current date and time, as yyyy/MM/dd HH:mm:ss.

The placeholders use single braces. Write them as is in YAML, properties files, environment variables, Helm values and Docker Compose files. In YAML, quote the text when it starts with {.

An unknown placeholder, or a date pattern that cannot be read, is left as written.

{user.name} is filled with the user's display name when the identity provides one:

  • With a JWT: the name claim, else preferred_username, else sub.
  • With a token validated by the provider: the displayName the provider answers, else the user id.

Placement​

PlacementDrawing
CENTEROne watermark centred on the page.
TOP_LEFTOne watermark in the top left corner.
TILEDThe watermark repeated over the whole page, in a staggered grid. Watermarks at the page edge are cut.

A single watermark (CENTER or TOP_LEFT) stays inside the page, with a 20-point margin. When the text is too long, the font shrinks down to 10 points, then the text wraps over several centred lines.

The watermark text is drawn with the font set in annotation.textual.unicode.font.path on the document converter, or Helvetica when it is not set. To watermark user names written in a script Helvetica cannot encode, set that font. See Fonts.

Broker settings​

PropertyDefaultDescription
watermark.on-the-fly.route-ttl-ms600000How long a viewing session keeps its view decision and its watermarked view copy. It is the time a revoked VIEW_UNMARKED or a changed view watermark takes to reach the page images.
watermark.on-the-fly.build-timeout-ms60000How long a request waits for a watermarked copy to be built.

Watermarking is always on: a user without a clearance always gets the watermarked copy.

Custom providers​

A custom provider sets its own watermarks by answering GET /documents/watermarks. A provider that does not implement it gets the built-in watermarks above. See Provider API: Watermarks.