cancel
Showing results for 
Search instead for 
Did you mean: 

PDF - container variables in a script

Former Member
0 Kudos

Hello.

Please tell me how I can refer to the variable container PDF if they are not on the screen.

For Example:

I imported from the interface in the container table IT_TAB with fields:

FIELD01

FIELD02

FIELD03

COLOR_LINE


In the form of PDF displays a table IT_TAB with fields:

FIELD01

FIELD02

FIELD03


That is a technical field COLOR_LINE.


For example I want to change the color of rows in the table, depending on the value of the field COLOR_LINE. I write the following script:


data.#subform[1].IT_TAB.DATA::ready:layout - (JavaScript, client)


DATA.fillColor = DATA.COLOR_LINE;


But the variable is not defined COLOR_LINE. How can I get the value from the field COLOR_LINE?

Accepted Solutions (0)

Answers (1)

Answers (1)

nikolayevstigneev
Contributor
0 Kudos

Hi, Andrey!

I usually use FormCalc to do some Adobe form scripting and it allows me to write things like:

if ( $.HIDE_BORDERS == "X" ) then

  $.MAKTX.border.getElement("edge",1).presence  = "invisible"

endif

Here HIDE_BORDERS is a technical column, $ refers to the table bodyrow: (IT_TAB.DATA in your variables).


You can test the syntax in FormCalc and optionally port it to JavaScript.

Former Member
0 Kudos

Hi, Nikolay.

In the language of FormCalc the same situation. If there is a technical column COLOR_LINE on the screen, I can not get its value (through $). I would not want to add a column to the PDF form, and then hide them, because a lot of them. Please tell me more a thread variant

nikolayevstigneev
Contributor
0 Kudos

Hi, Andrey!

It's difficult to guess the reason of the error without seeing your form. If it's possible for you can you show it?

If not, I would suggest the following:

1) ensure that there are no errors in another scripts with "Check script syntax" option. I usually do a simple test by clicking "Preview PDF" tab. If there are script errors, you'll get a popup notification about it.

2) does the script actually executes? As a test you can change the value of some header field inside the script.

3) do a simple test to see whether you get the value of the technical column - like $.FIELD01 = $.COLOR_LINE.

4) check the format of the colour you use. In Adobe's examples it's like "102,179,255". Maybe something's wrong with the cell type and the value you pass in the program gets corrupted?

There is a number of ways you can shoot your leg with Adobe forms. Those points to check is just what came to my mind at once