automatically Checkbox Checked if filename contains specific word (adobe dc javascript)
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,
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));
Copy link to clipboard
Copied
Hi Try67,
This is amazing 🙂 Thank you so much worked first time no problems at all!
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
Copy link to clipboard
Copied
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.

