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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list still contains old values after form rendering


Level 2
I have developed a pdf that needs further rendering after user fill in the form, I simply create a button called "Print_A" that will run scripts to render the form, print it out (I use app.execMenuItem(Print) instead of and finally revert the rendered look back to the original look as user press the button before.

However, problem comes if I want to print a saved pdf without opening Acrobat (ie. from Window Explorer), I work it out by adding scripts to render the form at the forms prePrint event, the form did rendered and printed but only for the 1st page.

I have tried putting the script at the form's "docReady" event, the result is the same, only 1st rendered page got printed.

I have debugged and it seems that still remains 1 after form rendering (that is why only 1st page is printed), however, xfa.layout.pageCount() shows the correct no. of pages afer rendering.

I explicity assign the correct value to but it doesn't work, it is still equal to 1.

Any idea?
3 Replies


Level 4
I've encountered this problem also.

I worked it out as being the print command is sent before the form has finished rendering, so even though you are telling it to print say 5 pages, it can only see 1 so it passes that number through.

I haven't worked out a solution yet.



Level 10
If Thomas is correct you should be able to proove it by adding a second button to do the print. Hit the first button to fix up the rendering then hit the second button to do the print. Does it still happen?


Level 2
If the actions are separated by two buttons, one for rendering pages and the other for printing by ', "0", ( -1).toString(), 0, 0, 0, 0, 0)', then all rendered pages got printed, but if two actions are combined within one button, only 1st rendered page is printed.

However I solve the above case by using app.execMenuItem(Print) instead of, now all rendered pages got printed.

But if I print the pdf from Windows Explorer without opening Acrobat application, I can't manipulate the print action after rendering the form on DocReady or prePrint event, and so only 1st rendered page is printed.