Skip to main content
Participant
January 20, 2021
Question

How can I automatically generate a bookmark with the value of a given text field value?

  • January 20, 2021
  • 1 reply
  • 518 views

Hi. I am trying to automate a document (medical history) where I have a text field ("Combined allergies" ) where its value (text) is derived from several other fields (individual alllergies). I need this value to be automatically copied either to a new bookmark, or to a previous, fixed, bookmark, and if possible in red fonts (so as to alert me of patient's allergies). Is this possible? Thanks.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 20, 2021

Depends. Will you be using the file only in Adobe Acrobat? If so, then yes (although you'll need to provide some more information about whether you want it to create a new bookmark or edit an existing one, and which one). It will not work if used in the free Reader, though.

 

Here's an example code that sets the text of the first bookmark in the file to the field's value each time it changes, to be used at the end of the field's custom calculation script:

 

this.bookmarkRoot.children[0].name = event.value;

 

It assumes the bookmark already exists. The red text color can be applied manually.

Participant
January 20, 2021

Thank you!!! That worked just great.

Best regards,

[Private info removed by moderator]