Hi,
We have made our own components for displaying and filling forms and reports on the screen. Forms are displayed and stored page by page, but in reports the next page comes after the other. All elements have coordinates relative to the top left corner of the first page.
When printing a report, view use SetViewportOrgEx( ) with y parameter set to PAGE_HEIGHT * (CurrentPage - 1) * -1 to shift everything in to place.
This works ok for physical printing, but when printing to the wPDF-canvas, it doesn't shift it enough. On my default printer, it starts drawing page 2 at the bottom of page 2, and page 3 and so on comes blank.
I found that multiplying the PAGE_HEIGHT by the magic number 6 shifts everything into place, but selecting a different printer as default need for a different magic number....
Why do I need this magic number when printing to wPDF?
How can I find the right magic number?
regards,
-Vegar