Copy link to clipboard
Copied
I have a document in Adobe reader but I needed a way to change the colour of every other word automatically. Any help is appreciated. Thanks in advance.
[Spelling mistake corrected for clarity]
Copy link to clipboard
Copied
Not possible with Acrobat Reader.
Copy link to clipboard
Copied
What about in Acrobat DC?
Copy link to clipboard
Copied
Are you wanting to make a program to edit the colour of text on a page? Are you an experienced C++ programmer with Visual Studio installed?
Copy link to clipboard
Copied
No I am not skilled in any of those. I was hoping I could use some sort of script to change every other word in a sentence to the colour red.
Copy link to clipboard
Copied
Unless this text is a part of a form field or comment it's impossible to do it with a script.
Copy link to clipboard
Copied
Oh alright. I was hoping that it was possible with the JavaScript function because I've used it before to delete every other page in a document. What I wanted was so that it selects every nth word (in my case every second word) and changes the colour to red.
Copy link to clipboard
Copied
No, JS has no access to the properties of the static text on a PDF. It can only read its contents and location. The latter can be used to delete it using Redaction. However, it's also possible to use both of these things to "re-create" text, by placing a field or a comment over it with the desired formatting settings (such as red text).
This has a couple of limitations, though: The script can't know what font was originally used for the text, so you have to hard-code a specific font selection into it. It also can't know what's the color of the text itself (not a problem in this case, since you want to replace it with red text anyway), nor the background color on which it is placed. So if the text is not placed on top of a white background, and you don't hard-code the proper color into the script, the result will appear very odd.
The font size can be estimated based on the size of the area the text takes on the page, but it won't be 100% accurate, either.
If all of these issues are OK with you, or can be easily solved in your case (if the font, color, background color and text size are the same throughout the document), then yes, it can be done using a script, but it's quite a complicated task that will require the development of a custom-made tool.
Feel free to contact me privately via [try6767 at gmail.com] to discuss it further if you're interested in hiring a professional to create such a script for you.
Copy link to clipboard
Copied
Actually, I've use the redact annotation to replace text on the page. You can set the text that is dispalyed in the area where the redaction happens with a property on the annotation. For a word size area this would amount to a replacment. I don't know if the font properties can be set.
However, actually replacing half the text on a page might have some negative consequences. I wouldn't recomend it.
An easy alternative would be to place highlight annotations over every word.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now