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

automatically Checkbox Checked if filename contains specific word (adobe dc javascript)

New Here ,
Jan 22, 2021 Jan 22, 2021

Copy link to clipboard

Copied

Hi,

I am hoping someone maybe able to help. I have been looking through but nothing is specifically working for what I need.

I basically have a pdf with some document level javascript but would like to add some more.

Basically there are 5 checkbox each saying a deptartment like 'Finance'

I was wondering if I could get the checkbox to check when the document is automatically opened and it looks for specific string that contains (so it might have other text around it) "Finance"

 

So for example Filename: 'Document Invoice - Finance - 1234.pdf'

Ideally because the document title includes finance it would automatically check the textbox called 'Finance' on the PDF form? If finance wasn't there it wouldn't check the box at all

Any help would be much appreciated.

 

Many thanks,

TOPICS
Acrobat SDK and JavaScript , Mac , Windows

Views

208

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 ,
Jan 22, 2021 Jan 22, 2021

Copy link to clipboard

Copied

Sure, that's possible. You can do it using this script:

this.getField("Finance").checkThisBox(0, /Finance/.test(this.documentFileName));

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 ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

Hi Try67,

 

This is amazing 🙂 Thank you so much worked first time no problems at all!

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 ,
Mar 01, 2021 Mar 01, 2021

Copy link to clipboard

Copied

I hope you have had a lovely weekend!
I am sorry to ask for your advice again, I was wondering is it possible to search for text in a documment page and if it contains the text to either add an image or Watermark via Javascript. Ideally I would like the Image to be in the same place everytime so that's why I am thinking a watermark work better potentially.

Many Thanks,

 

Sam

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 ,
Mar 01, 2021 Mar 01, 2021

Copy link to clipboard

Copied

LATEST

Yes, that is possible, but it's a bit complex, especially if the text you want to search for is more than one word.

 

If you're interested I could develop this script for you, for a small fee. You can contact me privately via [try6767 at gmail.com] to discuss it further.

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