Generate colour behind text
-
- Newbie
- Posts: 3
- Joined: Thu Apr 28, 2022 11:44 pm
Generate colour behind text
Hi everybody, is there someone here that can assist me? Or at least point me in the right direction.
I need to create an action that selects text by specific font and size and draws a particular background colour behind it.
Similar to what the highlighter does in the comment tools, but it is not supposed to be a comment.
Attached you will find a screenshot explaining what I am trying to do.
I need to create an action that selects text by specific font and size and draws a particular background colour behind it.
Similar to what the highlighter does in the comment tools, but it is not supposed to be a comment.
Attached you will find a screenshot explaining what I am trying to do.
- JimmyHartington
- Advanced member
- Posts: 329
- Joined: Tue Mar 22, 2011 7:38 am
Re: Generate colour behind text
Hi
Are you able to provide a sample file?
A way to look could be to see if a selection finding the text segment. Setting the art box to the selection. Add rectangle based on art box.
What I am afraid of is that it would select all the headers and create an art box like in the image below.
Are you able to provide a sample file?
A way to look could be to see if a selection finding the text segment. Setting the art box to the selection. Add rectangle based on art box.
What I am afraid of is that it would select all the headers and create an art box like in the image below.
-
- Newbie
- Posts: 3
- Joined: Thu Apr 28, 2022 11:44 pm
Re: Generate colour behind text
Hi Jimmy, and thank you for your replay.
Here is a link to this file: https://www.althingi.is/lagasafn/pdf/152b/1991021.pdf
Whould be realy greatfull for all help that can lead to a solution of this problem.
Here is a link to this file: https://www.althingi.is/lagasafn/pdf/152b/1991021.pdf
Whould be realy greatfull for all help that can lead to a solution of this problem.
- JimmyHartington
- Advanced member
- Posts: 329
- Joined: Tue Mar 22, 2011 7:38 am
-
- Newbie
- Posts: 3
- Joined: Thu Apr 28, 2022 11:44 pm
Re: Generate colour behind text
WOW..! Thanx so much.
This is fantastic solution, I was stuck in drawing boxes, and didn't have idea to look out of the box
Also did I not realize I could seperate stroke from fill.
Again, thank you so much, you saved me a lot of time.
This is fantastic solution, I was stuck in drawing boxes, and didn't have idea to look out of the box
Also did I not realize I could seperate stroke from fill.
Again, thank you so much, you saved me a lot of time.
- JimmyHartington
- Advanced member
- Posts: 329
- Joined: Tue Mar 22, 2011 7:38 am
Re: Generate colour behind text
I got stuck on not being able to separate stroke and fill before I embedded the font and outlined it.
So if search in the pdf is important, then it will not work for those headings.
So if search in the pdf is important, then it will not work for those headings.
Re: Generate colour behind text
Good job, Jimmy!
I do have an alternative suggestion: selection of the text as you did, but then
Copy or cut objects to clipboard (then choose copy of course)
Select all
Paste objects from clipboard
Select last added objects
Convert text to outlines
etc.
This will keep the original text as text. That is perhaps not important in this case, I just wanted to point out the copy/paste possibility. And because you then have the text twice, once as text and once as outlines and the outlines are selected you can change the stroke and fill separately without having to embed the font, convert the outlines and separate fill and stroke.
Note the "Select all" between the copy and the paste. This is often forgotten and if you do not use it, it does not work. The reason for that is the following: all actions only work when the selected objects are relevant for that action: Select images, Convert text to outlines does nothing quite obviously. Similarly, select text, copy, paste does not work because you cannot paste on selected text, you have to paste on a page, hence "Select all" (Select page also works).
I do have an alternative suggestion: selection of the text as you did, but then
Copy or cut objects to clipboard (then choose copy of course)
Select all
Paste objects from clipboard
Select last added objects
Convert text to outlines
etc.
This will keep the original text as text. That is perhaps not important in this case, I just wanted to point out the copy/paste possibility. And because you then have the text twice, once as text and once as outlines and the outlines are selected you can change the stroke and fill separately without having to embed the font, convert the outlines and separate fill and stroke.
Note the "Select all" between the copy and the paste. This is often forgotten and if you do not use it, it does not work. The reason for that is the following: all actions only work when the selected objects are relevant for that action: Select images, Convert text to outlines does nothing quite obviously. Similarly, select text, copy, paste does not work because you cannot paste on selected text, you have to paste on a page, hence "Select all" (Select page also works).
- JimmyHartington
- Advanced member
- Posts: 329
- Joined: Tue Mar 22, 2011 7:38 am
Re: Generate colour behind text
I thought of that.
But stopped when I need to paste it to the same coordinates.
I imagine I would need to create an object first which has the size of the Media Box.
Select that with the text.
And then I can paste at the center of the Media Box.
And then delete this object.
But I did not do it since I was not sure the way to use the stroke was good enough for bjorkollur.
If they want I will be happy to give it a try
Re: Generate colour behind text
You can paste objects in the same location: uncheck the option "Move graphic elements" in the Position tab. An unfortunate choice of default value perhaps?
- JimmyHartington
- Advanced member
- Posts: 329
- Joined: Tue Mar 22, 2011 7:38 am
- JimmyHartington
- Advanced member
- Posts: 329
- Joined: Tue Mar 22, 2011 7:38 am
Re: Generate colour behind text
I have now tried to make a new version with freddyp’s suggestions.
https://d.pr/f/NjLN8H+
And maybe freddyp can help again.
It works, but on pages with no headings of the selected type, they get pasted the content from the page before.
See this gif:
https://d.pr/f/NjLN8H+
And maybe freddyp can help again.
It works, but on pages with no headings of the selected type, they get pasted the content from the page before.
See this gif:
Re: Generate colour behind text
In the first tab: Clear clipboard after paste.
Re: Generate colour behind text
There is also another possibility: Select page if content is selected (select only the page object and of course more than 0 objects).
- JimmyHartington
- Advanced member
- Posts: 329
- Joined: Tue Mar 22, 2011 7:38 am
Re: Generate colour behind text
This did the trick.
Here is a new action list: https://d.pr/f/PPgZFR+
Just noticed that foot note indicatiors does not get marked. Because they are in a different font size.
- JimmyHartington
- Advanced member
- Posts: 329
- Joined: Tue Mar 22, 2011 7:38 am
Re: Generate colour behind text
And now luck will have it, that I can use this action list for a workflow internally.