replace text and keep original color in cmyk #1849
-
I am replacing the text of a pdf The best solution I came up with was taking the coordinates, fonts and color and then creating a new text with TextWriter. Visually everything seems fine, but when I went to print the pdf the color of the text that (I changed/created) was completely different from the color of a text that I didn't change. I'm using this code to apply color to the text: text_writer = fitz.TextWriter(
page.rect,
color=fitz.sRGB_to_pdf(textbox_info["color"]) # color from the page.get_text("dict")
) I believe the problem is in this sRGB_to_pdf. Is there any way to copy the color of an existing text using cmyk instead of RGB? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Interesting problem ... |
Beta Was this translation helpful? Give feedback.
-
What I don't understand however is, how can things be "visually" ok, but not on the printer? |
Beta Was this translation helpful? Give feedback.
-
I've also got the same problem. In Adobe Illustrator, the PDF file show CMYK is: 100, 0, 0, 0. PyMuPDF converted to RGB (0.0, 0.6809338331222534, 0.9379873275756836) => mean (R: 0, G: 174, B: 239). Unfortunately, there is no way to convert it back to 100, 0, 0, 0. Should we store the original colors instead of convert to RGB? For example, instead of returns RGB values, we should return the ColorSchema object that allow to convert or manipulate? |
Beta Was this translation helpful? Give feedback.
What I don't understand however is, how can things be "visually" ok, but not on the printer?