Set color of text based on background color

Post Reply
User avatar
JimmyHartington
Advanced member
Posts: 453
Joined: Tue Mar 22, 2011 7:38 am

Set color of text based on background color

Post 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.
yosimo
Member
Posts: 64
Joined: Tue Mar 27, 2018 6:25 pm

Re: Set color of text based on background color

Post 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
freddyp
Advanced member
Posts: 1129
Joined: Thu Feb 09, 2012 3:53 pm

Re: Set color of text based on background color

Post 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.
User avatar
JimmyHartington
Advanced member
Posts: 453
Joined: Tue Mar 22, 2011 7:38 am

Re: Set color of text based on background color

Post by JimmyHartington »

Thanks for the suggestions. I will try to see what I can do and report back later.
Post Reply