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

Execute Javascript in the background (asynchronous task)


Level 8

There is a form that requires images with more than 50 images.

We have developed an integrated Image Quality Process that will do the following:

  1. Upon inserting an image onto an image field, the process will generate 3 version of the image quality: Low, High, Original, and save them on the server
  2. Before submit, bring the low quality version for all image fields
  3. On form load, bring the original quality for all image fields.

Now the above is working fine, but as you might have guessed, there is a performance hit, which is bad.

Now, we are introducing a new change which is as follows:

  1. No change when inserting new image.
  2. Before submit, set all image fields to null (or to a very small version of the image), this will be make it much faster to submit (hopefully).
  3. On form load, bring all image fields using asynchronous process, in other words, in a background job. This will allow the user to start working on the PDF Form which the images are being loaded.


How we can run a process or a function in Javascript under XFA in the background? Do you think this is a practical solution?


1 Reply


Level 10

Hi Tarek,

That is quite a challenge.

I think I would try and trigger the image loading in a layout event, so once an image is rendered the code in the layout event will make a server call to render the next image, which will fire another layout ready event.

There will be a bit of work to keep track of where you are up to and when you have got to the last image.

Have a look at this sample. Adobe LiveCycle Designer Cookbooks by BR001: Season Planner (or Year Planner) PDF Template , doesn't do any server calls but does use the layout ready event to continue the next layout.