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

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

New Here ,
Oct 15, 2021 Oct 15, 2021

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!

TOPICS
Create PDFs , Edit and convert PDFs , General troubleshooting , How to , PDF forms
2.5K
Translate
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
1 ACCEPTED SOLUTION
LEGEND ,
Oct 16, 2021 Oct 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.

View solution in original post

Translate
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
LEGEND ,
Oct 16, 2021 Oct 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.

Translate
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 Beginner ,
May 16, 2024 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.

Translate
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
LEGEND ,
May 20, 2024 May 20, 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?

Translate
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 Beginner ,
May 21, 2024 May 21, 2024

Hi! and thanks for the reply.

No I'm not currently using a script. I have no experience with custom scripts in Acrobat, I just know that it's possible.

Our situation is that a client wants to copy text into a form field and retain the custom font, size, color. They need the number of characters to be flexible and the font needs to get smaller if needed when the message is longer. We're talking about 3-4 lines in a multi-line text field. We are assuming that the client has Reader not Acrobat Pro.

Translate
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 Beginner ,
May 21, 2024 May 21, 2024

Update: Adobe tech support just told me I have to have Acrobat API or SDK to use javascripts. Acrobat Pro that comes with CC is not enough.

Translate
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 ,
May 21, 2024 May 21, 2024

This info is not correct!

Translate
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 Beginner ,
May 21, 2024 May 21, 2024

That is not a surprise (that this info is incorrect).

Translate
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 Beginner ,
Jan 07, 2025 Jan 07, 2025

Hello, what do you mean with CC ?
I'm having the same issue, trying to fill text fields with text with styles, using Java, and writting XML for example. But it seems it doesn't work.

Translate
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 Beginner ,
Jan 07, 2025 Jan 07, 2025
Translate
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 07, 2025 Jan 07, 2025
Translate
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 Beginner ,
Jan 08, 2025 Jan 08, 2025

In practice, what does this mean, is a new package needed in Java ? Or how could I write richtext in Java into these fields?

Translate
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 08, 2025 Jan 08, 2025
LATEST

Acrobat uses Javascript, not Java.

Translate
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