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

Rich text "above/below" spacing possible with JavaScript?

New Here ,
May 07, 2018 May 07, 2018

Copy link to clipboard



I have been attempting to modify the paragraph spacing of a rich text field in my pdf with no luck, and I'm wondering if it's even possible.

Using the spans object, I can easily modify the linespacing, alignment, etc.

I have a Visual Basic application that dynamically batch builds company pdf documents for the client. However, for one particular document they are requiring the spacing of the field to be more specific, which requires me to adjust the "above/below" paragraph spacing of the rich text and not just the exact linespacing.

On a separate pdf file, I have tried enumerating all of the rich text properties of a field that I've manually made these modifications to, like so:

var f = this.getField("Text1");

var spans = f.richValue;

for ( var i = 0; i < spans.length; i++ ){

     for ( var key in spans ){

          app.alert(key + " : " + spans[key]);



But none of the properties it returns match what I'm looking for.

My only other solution right now is to scratch using the multi-line fields and write each line as new field so that I can control the spacing.. but that is less than ideal.

Is it maybe possible to copy the richValue of one field into another field, but then write a different value, perhaps?

I would appreciate any insight on this!

Thank you!!

Acrobat SDK and JavaScript , Windows







Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation