|
| 1 | +--- |
| 2 | +title: PDF Watermark | How Tos | PDF Services API | Adobe PDF Services |
| 3 | +--- |
| 4 | +<InlineAlert slots="text"/> |
| 5 | + |
| 6 | +PDF Watermark is currently accessible through the REST API only. |
| 7 | + |
| 8 | +# PDF Watermark |
| 9 | + |
| 10 | +A watermark in a document is usually semi-translucent or faded text, a logo, or a pattern placed in the background or foreground of the page for security, authenticity, and branding. |
| 11 | + |
| 12 | +PDF Watermark API is a cloud based solution to apply watermark on specified pages of a PDF document using a source file. |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | +## Input Documents : **Required** |
| 17 | + |
| 18 | +Supported format is PDF (application/pdf). Input PDF with version 1.6 and above is supported. |
| 19 | + |
| 20 | +### Input Document |
| 21 | + |
| 22 | +A PDF document to which a watermark will be applied. |
| 23 | + |
| 24 | +### Watermark Document |
| 25 | + |
| 26 | +A PDF document whose first page will be used as a watermark for the input document. |
| 27 | +The output generated will retain the content along with the watermark from the first page. |
| 28 | + |
| 29 | +## Watermark Parameters |
| 30 | + |
| 31 | +### Page ranges (_pageRanges_) |
| 32 | + |
| 33 | +Specifies the number of pages on which the watermark will be applied. Page numbers are indexed from 1 to N. |
| 34 | +The page ranges are specified as an array of objects whose length cannot exceed beyond 20. Each object has the following properties: |
| 35 | +* **Start Page** (*start*) : The first page number of the range. Default value is 1. |
| 36 | +* **End Page** (*end*) : The last page number of the range. Default value is the last page of the document. |
| 37 | +: |
| 38 | +### Appearance (_appearance_) |
| 39 | + |
| 40 | +* **Foreground** (*appearOnForeground*) : Specifies the placement of the watermark on the page. It can appear in the foreground or background. The default value is true, placing the watermark in the foreground. |
| 41 | +* **Opacity** (*opacity*) : Specifies the opacity of the watermark, represented as an integer percentage value ranging from 0 to 100. The default value is 100. |
| 42 | + |
| 43 | +## REST API |
| 44 | + |
| 45 | +See our public API Reference for [PDF Watermark API](../../../apis/#tag/PDF-Watermark). |
| 46 | + |
| 47 | +## Apply Watermark on specified pages |
| 48 | + |
| 49 | +The sample below performs watermark operation applying watermark in foreground on specified pages of a given PDF. |
| 50 | + |
| 51 | +Please refer the [API usage guide](../gettingstarted.md) to understand how to use our APIs. |
| 52 | + |
| 53 | +<CodeBlock slots="heading, code" repeat="1" languages="REST API" /> |
| 54 | + |
| 55 | +#### REST API |
| 56 | + |
| 57 | +```javascript |
| 58 | +curl --location --request POST 'https://pdf-services.adobe.io/operation/addwatermark' \ |
| 59 | +--header 'x-api-key: {{Placeholder for client_id}}' \ |
| 60 | +--header 'Content-Type: application/json' \ |
| 61 | +--header 'Authorization: Bearer {{Placeholder for token}}' \ |
| 62 | +--data-raw '{ |
| 63 | + "inputDocumentAssetID": "urn:aaid:AS:UE1:54cbf87f-d7f5-4918-8e4b-9f68", |
| 64 | + "watermarkDocumentAssetID": "urn:aaid:AS:UE1:54cbf87f-d7f5-4918-8e4b-9f1878678e68", |
| 65 | + "pageRanges": [ |
| 66 | + { |
| 67 | + "start": 2, |
| 68 | + "end": 5 |
| 69 | + }, |
| 70 | + { |
| 71 | + "start": 8, |
| 72 | + "end": 10 |
| 73 | + } |
| 74 | + ], |
| 75 | + "appearance": { |
| 76 | + "opacity": 50, |
| 77 | + "appearOnForeground": true |
| 78 | + } |
| 79 | +}' |
| 80 | +``` |
0 commit comments