Good day.
It is necessary to change the orientation of the page on the printer during printing. 1st page portrait, 2nd album, ... etc. The option to turn the landscape portrait into portrait by rotate (90) does not fit. As if the document will be printed in pdf (virtual printer), the document will be rotated. Office is able to change the orientation on the fly and everything turns out well. I did not manage to find a working example and could not write it (by replacing DevMode->dmOrientation=DMORIENT_LANDSCAPE after EndPage ).
Thanks for the help.