简体   繁体   中英

PDF4NET not executing the javascript in adobe livecycle form

I have javascript code in few events in an Adobe LiveCycle Form. When it is loaded with data using PDF4NET, it is not executing the javascript that exists in different events. Here is the sample code. Please help what I need to change in order to make it work.

Sample code in Livecycle form:

SampleForm::prePrint - (JavaScript, both, Propagation Enabled)

SampleForm.SubForm1.TextField1.rawValue=SampleForm.SubForm1.TextField2.rawValue;

Code in c#:

         PDFDocument pDFDocument = new PDFDocument(stream);

          ... populate fields  ......

        pDFDocument.get_Form().FlattenFormFields();
        System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
        pDFDocument.Save(memoryStream);
......

Thanks in advance for your help.

This is mostly guesswork because I don't know PDF4NET but one of these suggestions might work.

Having looked at the web site for PDF4NET, it looks like it only has support for static XFA forms. This means that it probably doesn't run the Javascript events. You can verify this by populating a field on the init event (of either the field or the form) and seeing if it works.

If the script events are running, depending on the Javascript interpreter and the XFA object model, your script might be wrong. It might not be able to resolve SampleForm from a script on SampleForm . Try putting the script on SubForm1 and changing it like this:

TextField1.rawValue = TextField2.rawValue;

If that fails you could try using resolveNode() to get the fields.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM