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

Retrieve list of fonts via JavaScript

Explorer ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

Hi everyone!

 

I'm not too hopeful about this one, but is there a way to retrieve a list of installed fonts available for use in Acrobat via JavaScript? Something similar to app.fonts in Extendscript?

 

I know this can probably be done with a Java library like PDFBox, but I wanted to make sure there's no way to achieve this with JavaScript before I go down that wormhole. I realize this might not be possible though.

 

Any push in the right direction is greatly appreciated. Thanks so much!

TOPICS
Acrobat SDK and JavaScript

Views

1.8K

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

correct answers 1 Correct answer

Community Expert , May 14, 2020 May 14, 2020

No, the installed fonts are not available to the Acrobat JavaScript model. This would be a great feature though. 

You can use any installed font if you already know the language independent name. The process for gettting the name is to set it in a form field, then acquire it with JavaScript in the console.  A bit laborious for creating a large list, but enough to build a small one.

 

I don't know if there is a relationship between the HTML font names and the ones used in Acrobat, but if there is

...

Votes

Translate

Translate
Community Expert ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

Want you a list of the installed fonts on the system?

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
Explorer ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

Yes, correct.

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 ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

Not 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
Community Expert ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

No, the installed fonts are not available to the Acrobat JavaScript model. This would be a great feature though. 

You can use any installed font if you already know the language independent name. The process for gettting the name is to set it in a form field, then acquire it with JavaScript in the console.  A bit laborious for creating a large list, but enough to build a small one.

 

I don't know if there is a relationship between the HTML font names and the ones used in Acrobat, but if there is one, then you could just create an array of names in a browser console and copy it into an Acrobat script. 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
Explorer ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

Perfect, I actually think this workaround could work in my case. Thank you so much—appreciate the help!

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 ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

LATEST

If you want this to be done purely in the Acrobat environment, then you'll need to use a plug-in.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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