Skip to content

Commit

Permalink
DOC: Improve watermark docs (#2113)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan6419846 authored Aug 24, 2023
1 parent 89eb626 commit 9ba17e7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/user/add-watermark.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ Adding stamps or watermarks are two common ways to manipulate PDF files.
A stamp is adding something on top of the document, a watermark is in the
background of the document.

## Stamp (Overlay) / Watermark(Undelay)
## Stamp (Overlay) / Watermark (Underlay)

The process of stamping and watermarking is the same, you just need to set `over` parameter to `True` for stamping and `False` for watermarking.

You can use `merge_page()` if you don't need to transform the stamp:

```python
from pypdf import PdfWriter, PdfReader

Expand All @@ -20,7 +21,7 @@ for page in writer.pages:
writer.write("out.pdf")
```

Else use `merge_transformed_page()` with Transformation() if you need to translate, rotate, scale, etc. the stamp before merging it to the content page.
Else use `merge_transformed_page()` with `Transformation()` if you need to translate, rotate, scale, etc. the stamp before merging it to the content page.

```python
from pathlib import Path
Expand Down Expand Up @@ -50,8 +51,10 @@ def stamp(
writer.write(pdf_result)
```

example of stamp:
If you are experiencing wrongly rotated watermarks/stamps, try to use `transfer_rotation_to_content()` on the corresponding pages beforehand to fix the page boxes.

Example of stamp:
![stamp.png](stamp.png)

example of watermark:
Example of watermark:
![watermark.png](watermark.png)

0 comments on commit 9ba17e7

Please sign in to comment.