Hello Alan,
Thanks for the tip, this is indeed very interesting. I wasn't aware about the ExecCommand method. However, what I'd like is to resize my element so it fits onto my A4 page completely, changing its aspect ratio if necessary. Your code basically zooms until the element's width equals the page's width without really resizing the element on both axis. I tried out some other commands available in the PrintingSystemCommand class, but nothing seems to be appropriate for my problem.
As workaround, I now temporary change the dimensions of the form the element is docked to, print, and reset the form's dimensions to the original values afterwards. Obviously this process is visible by the user, so I'm still looking for a more elegant solution.
Thanks again,
-Nico.