The StampOn and StampUnder functions stamp the first page of a source PDF onto or under each page in the given range of a given document.
The CombinePages function takes two PDF documents and stamps each page of one over the corresponding page in the other. Page attributes (such as the display rotation) are taken from the "under" file. For best results, remove any rotation differences in the two files using Upright and SetMediabox first.