Replies: 2 comments 2 replies
-
|
This is what it looks like : from fpdf import FPDF
from pathlib import Path
class WatermarkPDF(FPDF):
def __init__(self, watermark_text=None, opacity=0.3, *args, **kwargs):
super().__init__(*args, **kwargs)
self.watermark_text = watermark_text
self.opacity = opacity
def footer(self):
if not self.watermark_text:
return
gray = int(255 * (1 - self.opacity))
self.set_font("Helvetica", "I", 8)
self.set_text_color(gray, gray, gray)
text_width = self.get_string_width(self.watermark_text)
x = self.w - text_width - 10
y = self.h - 10
self.text(x, y, self.watermark_text) |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Hi @ByZay Thank you for the kind words. You can definitely submit a PR with the tutorial 7 translation. Regarding the watermark feature, I suggest you to open an issue with feature request and we can discuss the API for this feature. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I hope you're doing well. Recently, I've been browsing GitHub looking for promising and interesting projects. I've been testing fdpf2 locally for a few days now, and it's truly admirable work from all the contributors. So, I'd like to ask if I could join you with some ideas I have.
I already have a few suggestions that I think would be a nice addition to the modules you've added to your code. I'd like to share them with you, please let me know what you think:
Thank you for taking the time to read my message. I hope any help is welcome, and I’d be happy to be part of your project.
Have a great day,
Zay
Beta Was this translation helpful? Give feedback.
All reactions