We are using Cocoon to generate a pdf file using XML and the number of pages
the file contains depends on user input.
The problem is that for legal reasons we need to have a footer with Page
1 of 6, Page 2 of 6 etc...

Engine cocoonEngine = Engine.getInstance();
CocoonServletRequest myReq = new CocoonServletRequest(mS_XMLFile, aHSRq_request);
cocoonEngine.handle(myReq, aHSRp_response);

We need to be able to parse the file generated by cocoon, but we haven't
managed to find a way to redirect the output from the cocoon Engine.

Does anyone have any ideas?

Thanks in advance