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

Does PDF-forms work with paragraph-styles?

New Here ,
Oct 31, 2017 Oct 31, 2017

Hi there! My Question is: Does PDF-forms work with paragraph-styles? I need this for a form of a ID-card.

TOPICS
PDF forms
4.4K
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 ,
Dec 28, 2017 Dec 28, 2017

The answer is Sort Of. If all you want is a multi-line input then that's easy, it's a setting on the Options tab of the field properties dialog. But if you want real styles, then you need to use rich text, which can have some paragraph formatting. In Acrobat JavaScript rich text is defined by the "span" object,

Acrobat DC SDK Documentation

Unfortunately the paragraph options are not documented, they're there, just not in the documentation. The way to get the paragraph styling parameters is to  set a text box to accept rich text, then use the popup formatting options one at a time. Each time get the spans object for the field and see whats in there. Not an easy process, but doable.

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
Adobe Employee ,
Dec 28, 2017 Dec 28, 2017

Hi Hansjürgl,

Sorry for the delay in response.

Yes, you can set text field properties to multiline. Please refer to the links given below which discuss more on this:

how do I create a form field for a paragraph response?

Adding a multiline text field > Adding Form Fields with Acrobat XI

How do I create a multi-line text box?

Feel free to update this discussion if you need any further help.

Shivam

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 ,
Dec 28, 2017 Dec 28, 2017

The answer is Sort Of. If all you want is a multi-line input then that's easy, it's a setting on the Options tab of the field properties dialog. But if you want real styles, then you need to use rich text, which can have some paragraph formatting. In Acrobat JavaScript rich text is defined by the "span" object,

Acrobat DC SDK Documentation

Unfortunately the paragraph options are not documented, they're there, just not in the documentation. The way to get the paragraph styling parameters is to  set a text box to accept rich text, then use the popup formatting options one at a time. Each time get the spans object for the field and see whats in there. Not an easy process, but doable.

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
Community Expert ,
Nov 26, 2021 Nov 26, 2021

Hi,

I comeback to this post because I would like to know if it is possible to know all field text properties of a rich text field.

I modify the properties and I wrote this script :

var spans=this.getField("myField").richValue;
for (var i in spans) {
	console.println("span #"+i+":"+spans[i]);
	if (typeof spans[i]=="object") {
		for (var j in spans[i]) console.println("• "+j+" : "+spans[i][j]);
	}
}

In the console I only have the result for the font and only the alignment and line spacing for the paragraph.

Is it possible to read the idents and above/below spacing for the paragraphs? Is there something missing or wrong in my script?

Thanks

 

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 ,
Nov 26, 2021 Nov 26, 2021

No, it's not possible, unfortunately.

 

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 ,
Nov 26, 2021 Nov 26, 2021

Ok, thanks 

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 ,
Nov 27, 2021 Nov 27, 2021
LATEST

There are more rich text properties that can be set in the UI than can be set with JS. There are also more JS span properties than are documented. There are also properties you'll see in the span object that can be read, but not set through JS. 

 

 

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