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

Indentation/Align Text in Field

New Here ,
Jan 06, 2023 Jan 06, 2023

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.jpgexpand image

TOPICS
How to , PDF forms
979
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 ,
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. 

 

 

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

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

Not possible, unless you write a function that correctly calculates the width of the text and use that to add extra spaces to 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 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. 

 

 

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

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

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

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