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

tabStops in Acrobat XI Pro to generate a Table of Contents, text not filling

Community Beginner ,
Jun 12, 2016 Jun 12, 2016

Hi all,

I searched the forums for an answer, but couldn't find any. I'm setting the para.tabStops property via JavaScript (or attempting to) but don't see the fruits of my labor. The form field, after executing the script:

  1. isn't populating with any text
  2. doesn't have tab stops inside the field (verified with the Form Field Text Properties box)

Here's my code snippet:

  //http://blogs.adobe.com/dmcmahon/2012/10/16/acrobat-xi-new-tab-stop-feature-available-for-rich-text-f...

  //http://blogs.adobe.com/formfeed/2009/06/managing_tab_stops_in_fields.html

  //section, subsection, pages, date, revision

  //defines tab stops for text box, use "\t" to insert a tab

  this.getField("1-1ListOfEffectivePages_M").para.tabStops = "left 0in left 0.25in left 3in left 4.5in left 6in";

  var TOCLines = new Array();

  TOCLines[0] = new Object();

  TOCLines[0].text = "Table of Contents" + "\t\t" +  "I" + "\n";

  TOCLines[0].weight = 900; //bold

  TOCLines[0].textSize = 12;

  TOCLines[0].textColor = color.black;

  TOCLines[1] = new Object();

  TOCLines[1].text = "\t" + "List of Effective Pages" + "\t" + "1-1" + "\t" + Date + "\t" + "N/A" + "\n";

  TOCLines[1].textSize = 11;

  TOCLines[1].textColor = color.black;

  //...

  TOCLines[23] = new Object();

  TOCLines[23].text = "Miscellaneous Information" + "\t\t" + "XI" + "\n";

  TOCLines[23].textSize = 12;

  TOCLines[23].weight= 900;

  TOCLines[23].textColor = color.black

  //commit to TOCBox

  this.getField("1-1ListOfEffectivePages_M").richValue = TOCLines;

Obviously, the field I want filled is "1-1ListOfEffectivePages_M" and that's in the PDF.

From what I can tell, there isn't an issue with the code (that's what they all say, right?). Online documentation seems lacking though.

I suspect it may be because my PDF form is not dynamic, but I don't know how to verify that.

TOPICS
Acrobat SDK and JavaScript
678
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

correct answers 1 Correct answer

Community Expert , Jun 12, 2016 Jun 12, 2016

There are dynamic XFA forms and static XFA forms, and there are AcroForms... If you have an XFA form then you will only be able to edit it using LCD. AcroForms can only be edited in Acrobat.

If you converted your entire form to XFA then your code should work in Acrobat/Reader, yes, but this is not a trivial task, and you'll need to purchase LCD as it's no longer bundled with Acrobat, like it used to be.

Translate
Community Expert ,
Jun 12, 2016 Jun 12, 2016

There's no such thing as "tab stops" in an Acrobat form. The article you found refers to PDF files created using LiveCycle Designer, which is a completely different thing.

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 ,
Jun 12, 2016 Jun 12, 2016

Acrobat XI: new tab-stop feature available for rich-text fields explicitly states Acrobat XI in the title. From other resources I guessed I could specify these tab stops with JavaScript.

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 ,
Jun 12, 2016 Jun 12, 2016

The first sentence of this article states:

With the latest release of Adobe Acrobat/Reader XI there is a new feature available for structuring text in rich-text fields in XFA-based forms.

XFA forms are forms created using LCD.

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 ,
Jun 12, 2016 Jun 12, 2016

Right, so I asked

I suspect it may be because my PDF form is not dynamic [i.e. XFA], but I don't know how to verify that.

This is an inherited project, so I wasn't sure. I'll see about acquiring LiveCycle.

If the form was re-made with LCD, would the code work as executed from Acrobat or Reader?

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 ,
Jun 12, 2016 Jun 12, 2016

There are dynamic XFA forms and static XFA forms, and there are AcroForms... If you have an XFA form then you will only be able to edit it using LCD. AcroForms can only be edited in Acrobat.

If you converted your entire form to XFA then your code should work in Acrobat/Reader, yes, but this is not a trivial task, and you'll need to purchase LCD as it's no longer bundled with Acrobat, like it used to be.

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 ,
Jun 12, 2016 Jun 12, 2016
LATEST

Alright, 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