Changing watermark based on the page number

If you want to change the watermark depending on the page number it would be intuitive to place the code in a pre-section trigger on the first header section on the page.

However, watermarks are written out before the first header is printed which means that you cannot use that approach to change it. Instead it has to be done before the first page is printed, and then again before each page break, in order for the watermark to print correctly.

Below is an example on how to get A.pdf to print on the first page, B.pdf on the second and C.pdf on the rest: