jorisschellekens / borb

borb is a library for reading, creating and manipulating PDF files in python.
https://borbpdf.com/
Other
3.4k stars 147 forks source link

Watermark Feature Request #158

Closed drexhacker closed 1 year ago

drexhacker commented 1 year ago

Is your feature request related to a problem? Please describe. No problem at all but all in all for me this would give a full PDF package borb.

Describe the solution you'd like It would be really nice if this library supported embedding watermarks both image & Text into PDFs.

Describe alternatives you've considered I prefer borb and don't want to use other alternatives.

Additional context Nothing more just want normal Watermarks.

jorisschellekens commented 1 year ago

Watermark annotations are deprecated in PDF.

There are options to mimic this:

Any preference?

drexhacker commented 1 year ago

In my case I wanted an Image Watermark, so the first option can work for both scenarios (Text, Image) if we could have a utility class to generate this. On making research I was able to achieve similar functionality with other python modules, through merging the watermark document with the content document. Though both documents had have similar sizes and orientation. If there is a possibility of either mimicking this behavior or implementing the feature in another way, I would really appreciate.

Because in Python borb holds the flag for generating, modifying and creating pdf documents and I really like its code structure.

@jorisschellekens Thanks for the very Good Work.

jorisschellekens commented 1 year ago

I'm adding support for transparent images in the next release. That ought to make it easier to watermark a PDF.

Your workflow would then be:

I hope that works for you. You can expect this functionality in the next release (as well as a test to verify this works).