Watermarker.get_content() returns a PdfContent whose pages expose three collections of existing objects: xobjects, artifacts, and annotations. You can iterate them to read their properties, modify them, or remove them.
Extract information about page objects
The example below reports the objects on the first page of a watermarked PDF.
You can replace an object’s text by assigning to obj.text, replace its image by assigning bytes to obj.image_data, and add a watermark to an image object via image.add(watermark) after locating it with page.find_images().
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Ask AI
Ask anything about this page — the answer is based on its content.
Searching the docs and writing an answer…
Something went wrong while getting an answer. Please try again in a moment.