From this information I need to calculate how many sheets we need to print in order to print the ordered number of copies.
As I know the sheet size I can calculate how many copies will fit along the width and height of the sheet. I then need to divide the number of ordered copies by this number to get the run length. Atleast that's the theory of it, but how on earth do I convert it into practise?
If I try to do the math as a variable the number of characters needed to define it is huge...

Doing the math in Javascript would be easier, but how do I read the XML file, which will have a different name for every job that is processed, into the Javascript so I can define variables for the calculations and how do I return the run length to the XML file?
