Expand my Community achievements bar.

SOLVED

Acrobat Javascript vs LiveCycle Javascript

Avatar

Level 2

Hi experts

I am trying to access active document PDF file name in Live Cycle Javascript How this can be possible? I can understanad the below command for Acrobat Javascript

var mydocname= this.documentFileName;

In Live Cycle how can i access this value

Thanks in advance

Regards

arul

1 Accepted Solution

Avatar

Correct answer by
Level 5

HI,

you can use

event.target.documentFileName;

Hope this helps

Malcolm

View solution in original post

3 Replies

Avatar

Correct answer by
Level 5

HI,

you can use

event.target.documentFileName;

Hope this helps

Malcolm

Avatar

Level 2

Hi  BarlaeDC

Thanks for your help. Here I am trying to add water mark on condition bases

var pass_word = PasswordField1.rawValue;

if(pass_word=="itsme")
{
var myDoc = event.target.documentFileName;

myDoc.addWatermarkFromText(

"Confidential",

0,

font.Helv,

24,

color.red

);

}

This can be possible?

Thanks in advance

Avatar

Level 5

Hi,

I don't think you can add a watermark in that manner to a form designed in LiveCycle as the watermark is added to an Optional Content Group and I don't think these can be created in LC forms ( maybe someone else can confirm that?)

As to your code this call

var myDoc = event.target.documentFileName;

returns a string containing the name of the document, not the document itself.

to get the access to the document object you would change that to

var myDoc = event.target

Although as stated above I do not think you can add a watermark to a LC Form in this manner.

Hope this helps

Malcolm