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

How to Add Bold to Java code in PDF

Community Beginner ,
Sep 09, 2024 Sep 09, 2024

Here is my code for the first line:

"<b>Client Services</b>+\r"+line1+line2+"Reviewers\r"+line3+line4+line5+line6+line7+

 

Here is the output:

Client Services<b>Client Services</b>+

 

How do I get it to add the bold without the <b>Client Services</b>+ after it?

 

TOPICS
Modern Acrobat , PDF , PDF forms
989
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
Community Expert ,
Sep 09, 2024 Sep 09, 2024
event.target.richText=true;
var lines1="Line 1\rLine 2\r\r";
var lines2= "Line 3\rLine 4\rLine 5\rLine 6\rLine 7";

var spans = new Array();
spans[0] = new Object();
spans[0].text="Client Services\r";
spans[0].fontWeight=900;

spans[1] = new Object();
spans[1].text = lines1;

spans[2] = new Object();
spans[2].text="Reviewers\r"
spans[2].fontWeight=900;

spans[3] = new Object();
spans[3].text = lines2;

event.target.richValue=spans;

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
Community Expert ,
Sep 09, 2024 Sep 09, 2024

What is the context of your script?

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 ,
Sep 09, 2024 Sep 09, 2024

There are check boxes that the user clicks and a summary of the user's selections on the final page. The line 1, line 2, line 3, and so on are the user's selections. The Client Services and Reviewers are headings to separate the sections.

 

Client Services

Line 1

Line 2

 

Reviewers

Line 3

Line 4

Line 5

Line 6

Line 7

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 ,
Sep 09, 2024 Sep 09, 2024

So it's a multi-line 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 ,
Sep 09, 2024 Sep 09, 2024

Yes, exactly the code is in a multi line text field.

quote

So it's a multi-line text field?


By @PDF Automation Station

 

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 ,
Sep 09, 2024 Sep 09, 2024
event.target.richText=true;
var lines1="Line 1\rLine 2\r\r";
var lines2= "Line 3\rLine 4\rLine 5\rLine 6\rLine 7";

var spans = new Array();
spans[0] = new Object();
spans[0].text="Client Services\r";
spans[0].fontWeight=900;

spans[1] = new Object();
spans[1].text = lines1;

spans[2] = new Object();
spans[2].text="Reviewers\r"
spans[2].fontWeight=900;

spans[3] = new Object();
spans[3].text = lines2;

event.target.richValue=spans;
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 ,
Sep 10, 2024 Sep 10, 2024
LATEST

Thank you!

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