Page 1 of 1

Set color of text based on background color

Posted: Wed Aug 14, 2024 11:49 am
by JimmyHartington
I have a customer where an automated system adds text on a pdf based on an element the customer has placed in the pdf.
Normally the text is just add on a white background.
But now some files has a dark red (or other color) below, where the text should be added.
Does anybody have any ideas how I could set the color of the text based on the lightness of the area where it should be placed?
I would like to do this automatically without having the customer supply info about if the file has a background color.

Re: Set color of text based on background color

Posted: Wed Aug 14, 2024 12:35 pm
by yosimo
Hi,
well, I don't have a solution, just a few little thoughts: as far as detecting the background is concerned, you could, for example, use the actions at selected points in the PDF to read out whether and which color is there. The report, called up via the Enfocus Navigator, shows the result on the Color Information page.
But I don't know how you can access the result there in order to trigger further actions depending on it.

Regards
yosimo

Image

Re: Set color of text based on background color

Posted: Wed Aug 14, 2024 2:24 pm
by freddyp
Select text segments
Select overlapping objects - Replace the current selection by objects that are overlapped by any object from the current selection
Select color, e.g. 100C/100M
AND
Log selection - Blue background has text on it

or some variation on the above.

Re: Set color of text based on background color

Posted: Wed Aug 14, 2024 3:35 pm
by JimmyHartington
Thanks for the suggestions. I will try to see what I can do and report back later.