So I think I have found a couple of issues with our code.
First, the filtering of what components get drawn for each page is wrong. It filters away components from previous pages, but not for following pages. So for a three page report, the first page will include all three pages, the second and third outside the page bounds, the second page will include page two and three, and the last one only page three.
Second, there seems to be an error related to the resolution of the printer vs the pdf. The PDFPrinter-component has its canvas reference set to printer, and in the call to StartPage( ), a resolution of 100 was passed in. The magic number 6 used in SetViewPort( ), worked in most sercomstances because most printer has an dpi of 600.
So by using the actual dpi from the printer in the call to StartPage( ), we no longer needed the magic number. What we then needed, though, was to scale everything else, but the code for that was already in place for drawing to a printer, so that was ok.
There seems to be a lot of other issues in this code, but for now everything seems to work - regarding size and positioning at least.
I got myself a new problem though. We draw a small bitmap on every page, and now this bitmap is drawn with a black background in the pdf. On screen and on printer it is ok, but not in the pdf output. I will send you a new debug-output together with the bitmap, and hope you have a solution for me.