How to detect font and change font with JavaScript
Copy link to clipboard
Copied
Hello to all,
I'd like your help in how to get the font name and size of the selected text and then change the font name and color of all words with that font name and font size using JavaScript.
Below is a kind of pseudocode what I thought.
For example:
var f = this.selectedtext.fontname
var s = this.selectedtext.fontsize
for each word with font f and s{
word.fontname = "Helvetica"
word.fontcolor = blue
}
Thanks in advance for any help
Copy link to clipboard
Copied
None of that is possible with Acrobat JavaScript.
Copy link to clipboard
Copied
Thanks for answer.
I have issues because I want to remove all Bibliography references at the bottom of each page. I could do it converting to MS Word but when I convert it, is has several fonts and sizes that match with the text that I want to preserve.
Do you know how could I do this?
Copy link to clipboard
Copied
If it's always at the bottom of the page, and isn't anything else in that area, you could use a script that adds a Redaction annotation over the same area of each page, and then applies it to remove the text from it.

