How to make the "Check Spelling" feature work on fully capitalised words?

Explorer ,
Nov 14, 2018

Copy link to clipboard

Copied

Hello, I am trying to make a code, where the "check-spelling" feature will work on fully capitalised words, I was wondering if there was a script to insert into the document for this to work in any way?

TOPICS
Acrobat SDK and JavaScript

Views

212

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

How to make the "Check Spelling" feature work on fully capitalised words?

Explorer ,
Nov 14, 2018

Copy link to clipboard

Copied

Hello, I am trying to make a code, where the "check-spelling" feature will work on fully capitalised words, I was wondering if there was a script to insert into the document for this to work in any way?

TOPICS
Acrobat SDK and JavaScript

Views

213

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
Nov 14, 2018 0
Engaged ,
Nov 15, 2018

Copy link to clipboard

Copied

I don't know how much code you have written but there is the ability to ignore the case if that is an option for you...

Here you can read more about it:

JavaScript ignoreCase Property

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...
Nov 15, 2018 0
Nov 16, 2018

Copy link to clipboard

Copied

I tried putting it into the Javascript for both the field, and the document Javascript, but it doesn't seem to work...

Here is that I have:

var str = "AaBbCcDdEeFfJjHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz";

var patt1 = /ABCDEFGHIJKLMNOPQRSTUVWXYZ/i;

var res = patt1.ignoreCase;

It won't correct the word, "ADVOL" but it will correct it when it is lower-case.

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...
Nov 16, 2018 0
Engaged ,
Nov 19, 2018

Copy link to clipboard

Copied

So this could be a more efficient regExp for search all words and ignoring the case.

/([A-Z])\w+/gi

If you could post your full script we might be able to help more.

I would also recommend checking this site out to see if your regexp catches specific words you are concerned about... (plus it helps show what your code is doing at the bottom.

https://regexr.com/

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...
Nov 19, 2018 1
Nov 19, 2018

Copy link to clipboard

Copied

I see... I will be honest, I am new to coding with Javascript, but the script I posted in my previous comment is all I have gotten thus far.

How would I inject:

/([A-Z])\w+/gi

into my script to make spell-check work on fully capitalised words, if you don't mind me asking

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...
Nov 19, 2018 1