andrew@nro.cs.athabascau.ca (Andrew Folkins) (04/30/91)
Hi folks. Here's the deal. I want to generate some output, with some pages printed in portrait orientation and some in landscape. Is there a simple way to do this? It would appear that the answer is the printer escape GETSETPAPERORIENT (that might be PAGE, it's _not_ PRINT). MicroSoft very kindly documented it in the SDK, but neglected to include a #define in "windows.h". I know they say 'try not to use this', but does anyone out there know the proper value of the #define? The 'correct' method is supposedly to use ExtDeviceMode, but I get the impression that I'll have to re-create the printer device context every time I want to change the paper orientation (so that the device context reflects the current physical page size and layout). I would rather not have to start a new document every time I switch page orientation. Andrew Folkins ersys!andrew@nro.cs.athabascau.ca Edmonton Remote Systems: Serving Northern Alberta since 1982
ebergman@isis.cs.du.edu (Eric Bergman-Terrell) (05/03/91)
The solution is to add a "Setup P&rinter..." submenu under the "File" menu. When the user chooses the submenu, call the code presented in Petzold, pp. 731, 732. Anyway when the user selectes the "Setup P&rinter" submenu, that person will be presented with a big dialog box allowing them to change the configuration of the printer (including changing from portrait to landscape & vice versa). Then when your program gets an hdc for the printer and starts issuing gdi commands, they will be printed as requested by the user. Note: I know that this works fine with graphics. I don't know how text is handled (esp. device fonts for dot matrix printers). However I will know in a few days. Terrell