Retrieve list of fonts via JavaScript

Explorer ,
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!

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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. 

TOPICS
Acrobat SDK and JavaScript

Views

561

Likes

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

Retrieve list of fonts via JavaScript

Explorer ,
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!

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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. 

TOPICS
Acrobat SDK and JavaScript

Views

562

Likes

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
May 14, 2020 0
Adobe Community Professional ,
May 14, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
May 14, 2020 0
Explorer ,
May 14, 2020

Copy link to clipboard

Copied

Yes, correct.

Likes

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
Reply
Loading...
May 14, 2020 0
Adobe Community Professional ,
May 14, 2020

Copy link to clipboard

Copied

Not possible with Acrobat Javascript.

Likes

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
Reply
Loading...
May 14, 2020 0
Adobe Community Professional ,
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. 

Likes

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
Reply
Loading...
May 14, 2020 0
Explorer ,
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!

Likes

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
Reply
Loading...
May 14, 2020 1
Adobe Community Professional ,
May 14, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
May 14, 2020 0