Skip to main content
Participant
October 16, 2021
Answered

Need Custom Script to maintain text field properties AND give user Rich Text Formatting

  • October 16, 2021
  • 1 reply
  • 2948 views

Using Acrobat Pro I created a fillable PDF form for my clients who copy and paste a large amount of information. Because they are using Acrobat Reader, I have designated text field properties with desired font and size, multi-line, check spelling, etc...and enabled "rich text formatting" so that they can manipulate their "raw" text as needed to be bold, italic, underlined, etc. However, when my client attempts to copy/paste source text into the desired form field, the information is retaining "source" formatting rather than what is already designated in the field properties. (Even occurs when source text is .txt - raw 'unformatted text'.)

 

Yes, I get that this is relates to the designation of "Rich Text Formatting." Does anyone have a Custom Format Script to use to circumvent the issue?

 

Thanks in advance!

Correct answer ls_rbls

See the example on Page 658 of the Adobe Acrobat SDK JavaScript API, JavaScript™ for Acrobat® API Reference -- "Span properties"

 

 

It explains how to use Span properties to pass rich text to a rich text field.

1 reply

ls_rbls
Community Expert
ls_rblsCommunity ExpertCorrect answer
Community Expert
October 16, 2021

See the example on Page 658 of the Adobe Acrobat SDK JavaScript API, JavaScript™ for Acrobat® API Reference -- "Span properties"

 

 

It explains how to use Span properties to pass rich text to a rich text field.

Participating Frequently
May 16, 2024

Great info! I need the exact same functionality but the link isn't working anymore. This looks like the right place:

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#span

Thanks so much. I'll need help applying the script to my situation as I'm a novice a JS, but I'll find that somewhere.

ls_rbls
Community Expert
Community Expert
May 21, 2024

Thanks for updating this old thread.

 

Therw are still some old links on the Internet that you may download the older Acrobat JavaScript API reference guide in PDF format.

 

Would you mind explaining in more detail what do you need help with?

 

Also,  are you currently using a script ? If yes, do you mind sharing it?