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

Indentation/Align Text in Field

New Here ,
Jan 06, 2023 Jan 06, 2023

Copy link to clipboard

Copied

Is there a way to align text in a Text Field after inserting bullets? I have a script that inserts a bullet on each new line, but inputs that are too long will align left. My only idea is to insert a space on each line that isn't a "\n" new line. Any thoughts or suggestions? I have my script below and a screenshot of the results.

 

if(event.value != "") {

event.value = event.value.split(/[\n\r]/g).map(function(a){return "\u2b29 " + a}).join("\n");

}

Text Field.jpg

TOPICS
How to , PDF forms

Views

120

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jan 06, 2023 Jan 06, 2023

So you want a hanging paragragh. I think you might be able to do this with Rich Text.  Check out the options available by first setting it up manually with a rich text field.  Then use a script in the console window to see if the span properties, many of which are undocumented, provide support for the hanging paragraph. 

 

 

Votes

Translate

Translate
Community Expert ,
Jan 06, 2023 Jan 06, 2023

Copy link to clipboard

Copied

Not possible, unless you write a function that correctly calculates the width of the text and use that to add extra spaces to it.

Votes

Translate

Translate

Report

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 06, 2023 Jan 06, 2023

Copy link to clipboard

Copied

So you want a hanging paragragh. I think you might be able to do this with Rich Text.  Check out the options available by first setting it up manually with a rich text field.  Then use a script in the console window to see if the span properties, many of which are undocumented, provide support for the hanging paragraph. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

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
New Here ,
Jan 09, 2023 Jan 09, 2023

Copy link to clipboard

Copied

LATEST

Thank you for the suggestion! I'll post my solution if I'm able to get it working properly.

Votes

Translate

Translate

Report

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