• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to detect font and change font with JavaScript

New Here ,
Dec 19, 2019 Dec 19, 2019

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

 

 

TOPICS
Acrobat SDK and JavaScript

Views

617

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2019 Dec 19, 2019

Copy link to clipboard

Copied

None of that is possible with Acrobat JavaScript.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 19, 2019 Dec 19, 2019

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2019 Dec 19, 2019

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines