Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

RunAtServer script in XDP not executed in Form Server

Avatar

Not applicable
Hi, Expert,



I authored the form template in Designer 7.1 and generated PDF using SOAP client call 'renderForm()' successfully on Form Server with JBoss 3.x.



The problem is that the script in the template written in Designer set as 'RunAt=Server' never gets executed in Forms Server (the script is triggered in the event like 'form:ready' and 'layout:ready').



Is there any special options which shd be set in renderForm() call or the properties of XDP?



Any help is highly appreciated.



Thanks in advance

John
7 Replies

Avatar

Not applicable
Both of those events should fire on the server. Can you post a copy of your script here?



Rob

Avatar

Not applicable
Hi, Rob,



Thank you very much for the reply.



I call the renderForm() is like:



IOutputContext context = formServer.renderForm(

args[0], // name of XDP file

"PDFForm", // for interactive form

xmlBytes, // merged XML data

"CacheEnabled=False", // runtime options

null,

"http://localhost:8080/",

"http://localhost:8080/", // sTargetURL

"file:///d:/formsapi", // path of XDP file

null);



The script in XDP run at server in form:ready is like:



if (txtProductId.rawValue == null || txtProductId.rawValue == "") {

// hide it

txtProductId.presence = "hidden";

}



Thanks again

John

Avatar

Not applicable
Hello John,



I don't know about what doing the server-side scripting overall, but I noticed you set a field to "hidden". The hidden property excludes the field object from the layout, which from my understanding basically means the object isn't available for use at all. To just hide the field from displaying on the form, you would want to set it to Invisible.



That probably doesn't help your issue overall, but maybe will further down.



Good luck,

Jennifer

Avatar

Not applicable
Hi, Jennifer,



Thanks for the reply.



Yes I use javascript in XDP to set field's presence 'hidden' if its value is null or empty. I want this scriptlet to be executed on server side (which is executed by javascript engine in Form Server rather than that in client-side Adobe Reader). My problem now is that PDF can be generated successfully but the scriptlet is not run by Form Server. So the field is still visible even its rawValue is empty after data merging.



John

Avatar

Not applicable
Try changing your options string from "CacheEnabled=false" to "CacheEnabled=false&RenderAtClient=true". I think you need to generate a dynamic PDF to do this, and adding that option will make Forms render a dynamic one instead of a static one.



Chris

Adobe Enterprise Developer Support

Avatar

Not applicable
Hi, Chris,



Thank you very much for the reply.



I tried your solution by changing sOptions to "CacheEnabled=false&RenderAtClient=true" but it didn't work either. Yes form in XDP is a dynamic one and I set Server PDF Render Format to 'Dynamic PDF'.



I don't think there is something wrong in the script because previewed PDF shows the correct result after I change RunAt=Server to RunAt=Client.



Thanks again

John

Avatar

Level 2
John,



I had the same problem as you did, and I used your:



if (DateOfSale.rawValue == null || txtProductId.rawValue == "") {

// hide it

DateOfSale.presence = "hidden";

}



and it WORKED!



So - while it in no way contributes to this forum,

THANK YOU! THANK YOU! THANK YOU!!!!!