Not being able to import set_alpha() attribute #1269
Closed
Anirudh-Pranesh
started this conversation in
General
Replies: 1 comment 3 replies
-
Where have you seen that The "alpha" channel is defined by your source image, that must support transparency (.eg. PNG and not JPG). cf. https://py-pdf.github.io/fpdf2/Images.html#alpha-transparency |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have a program that is using fpdf. I recently decided to include a watermark for my pdf and uninstalled fpdf and installed fpdf2. but despite doing this, I am not able to import the set_alpha() attribute and python gives the error :
AttributeError: 'PDF' object has no attribute 'set_alpha'
Here is the code in question :
I have intsalled and unintsalled fpdf2 multiple times and nothing changes, it keeps giving the same error. For more context, the code was written by another colleague of mine, who used the same module fpdf2. It seems to be working for him but when i run this code on my system with the same module imported, the code raises an exception as decribed above. I am not sure about the python version and module version he used but here is mine :
python version : 3.11.4
fpdf2 version : 2.7.9
Any help would be greatly appreciated ! Thanks.
Beta Was this translation helpful? Give feedback.
All reactions