Adobe PDF Watermark and Stamp Confidential Documents
When a document is published or downloaded from a controlled library, the flow applies a dynamic watermark/stamp (CONFIDENTIAL, recipient name, date) with Adobe PDF Services and serves the watermarked copy, logging the action. Deters leaks and traces document copies back to a recipient.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow watermarks confidential documents with Adobe PDF Services. When a document is published to a controlled SharePoint library, the flow stamps a CONFIDENTIAL watermark onto it (via Adobe's addwatermark operation), serves the watermarked copy to an output library, and logs the action to Teams for traceability.
Status: Built (CF-544). Ships Off (reference demo). Going live requires only authorizing the connections and setting env-var values.
Why it matters: Unmarked confidential documents are easy to leak anonymously. A CONFIDENTIAL watermark plus a per-recipient traceability log deters leaks and helps trace any copy back to who received it. Adobe is called via the built-in HTTP action (token -> assets -> PUT -> operation/addwatermark -> poll -> download), so no Adobe connection reference is needed — credentials come from environment variables.
Use Case
Teams sharing sensitive PDFs want every published copy stamped CONFIDENTIAL and logged with the recipient + date so any leaked copy is traceable.
Flow Architecture
When A Document Is Published
SharePoint — GetOnNewFileItems (5-min poll, splitOn)Fires for each new file in the controlled library (site + library + folder bound from env vars).
Initialize variables
Initialize Variable (x12)Bind site URL, watermark template path, output folder, watermark text, opacity, recipient, Adobe base/client-id/secret, Teams group/channel, and seed the poll status.
Check File Is PDF
Condition (endsWith .pdf)Non-PDF files are skipped (empty False branch).
Get Source Document
SharePoint — GetFileContentRead the source PDF bytes.
Get Watermark Template
SharePoint — GetFileContentByPathRead the CONFIDENTIAL watermark template PDF.
Compose Traceability Stamp
ComposeBuilds CONFIDENTIAL - <recipient> - <date> for the log.
Get Adobe Access Token
HTTP — POST /tokenClient-credentials -> access_token.
Create + Upload Source PDF Asset
HTTP — POST /assets + PUT uploadCreate the source asset (uploadUri + assetID) and PUT the source PDF bytes.
Create + Upload Watermark PDF Asset
HTTP — POST /assets + PUT uploadCreate the watermark asset and PUT the watermark template bytes.
Compose Watermark Request
ComposeEnvironment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | Controlled-library site. (reused) |
| flowlibs_ControlledDocsLibraryID | String | <configure> | Library the trigger watches. (reused) |
| flowlibs_ControlledDocsFolderPath | String | /Shared Documents | Folder within the watched library. (new) |
| flowlibs_WatermarkTemplatePath | String | /Shared Documents/Templates/Confidential-Watermark.pdf | Watermark template PDF (server-relative path). (new) |
| flowlibs_WatermarkedFolderPath | String | /Shared Documents/Watermarked | Output folder for watermarked copies. (new) |
| flowlibs_WatermarkText | String | CONFIDENTIAL | Base stamp label recorded in the log. (new) |
| flowlibs_WatermarkOpacity | String | 35 | Watermark opacity percent (0-100). (new) |
| flowlibs_DocumentRecipientEmail | String | secure-recipient@your-tenant.onmicrosoft.com | Recipient identity for the traceability stamp. (reused) |
| flowlibs_AdobeClientId | String |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| SharePoint | shared_sharepointonline | GetOnNewFileItems GetFileContent GetFileContentByPath CreateFile |
| HTTP | http | POST /token POST /assets PUT upload POST /operation/addwatermark GET status GET download |
| Microsoft Teams | shared_teams | PostMessageToConversation |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Watermark template
- Swap flowlibs_WatermarkTemplatePath for any branded watermark PDF. Adobe addwatermark currently supports only a PDF watermark (not inline text), so the per-recipient/date text is recorded in the Teams log; to render dynamic text on the page, regenerate the watermark template per recipient or generate it on the fly with Adobe HTML-to-PDF / createpdf.
- Opacity & placement
- Tune flowlibs_WatermarkOpacity (0-100); the request uses appearOnForeground. Add pageRanges to the Compose Watermark Request to limit pages.
- Tiered stamps
- Branch on document classification metadata to pick different watermark templates (CONFIDENTIAL / INTERNAL / SECRET).
- QR trace
- Embed a QR code in the watermark template that links to the access log.
- Trigger on download
- Swap the new-file trigger for a Power Apps / Request trigger to watermark on download instead of on publish.
- Persistent audit
- Add a Dataverse CreateRecord alongside the Teams log for a queryable access trail.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01PDF gate
Only files ending in .pdf are processed.
EXPR.02Traceability stamp
Build the CONFIDENTIAL - recipient - date stamp text.
EXPR.03Adobe token body
Form-encoded client credentials for the Adobe token request.
EXPR.04Upload bytes
Convert the SharePoint base64 content to binary for the Adobe PUT.
EXPR.05addwatermark opacity (integer)
Coerce the opacity env var to an integer.
EXPR.06Poll exit
Exit the Until loop when the job is done or failed.
EXPR.07Download URI
Pre-signed download URI for the watermarked PDF.
EXPR.08Output name
Name the watermarked output copy.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.