-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set text color using CMYK colors? #1181
Comments
Hi @swasher Good question. from fpdf import FPDF
from fpdf.drawing import DeviceCMYK
pdf = FPDF()
pdf.add_page()
pdf.set_font("Helvetica", size=40)
pdf.set_text_color(DeviceCMYK(.32, 0, .1, .59))
pdf.cell(text="Hello world!")
pdf.output("repro.pdf") But currently, with I have just fixed that bug, and the fix will be included in the next version. For now, you can simply do this instead: from fpdf import FPDF
from fpdf.drawing import DeviceCMYK
pdf = FPDF()
pdf.add_page()
pdf.set_font("Helvetica", size=40)
pdf.text_color = DeviceCMYK(.32, 0, .1, .59)
pdf.cell(text="Hello world!")
pdf.output("repro.pdf") Does this answer your question @swasher? 🙂 |
@allcontributors please add @Lucas-C for bug |
I've put up a pull request to add @Lucas-C! 🎉 |
Hi Lucas! Thank you for your support, now I can use CMYK color without any problem!) |
Great! Closing this then 🙂 |
I want to use CMYK color space for object creation. But
FPDF.set_text_color()
method accept only RGB values:I found
DeviceCMYK
class indrawing.py
, but have no imagine how apply it toset_text_color
and similar functions.So, is there a way for assign CMYK color for object?
The text was updated successfully, but these errors were encountered: