Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
API call to change printer orientation to landscape
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00764222
Message ID:
00764256
Views:
28
Chris,

Are you starting and ending the Print Job yourself in code?

After you start a Print Job with BeginDoc(), you need to then update the DEVMODE structure field for the Page Orientation before you call the StartPage() function. You also need to set the bit for the DM_ORIENTATION field by doing an OR with the DEVMODE dmFields with "DEVMODE.dmFields OR DM_ORIENTATION". This tells the DEVMODE structure that you are making and update to the DEVMODE dmOrientation Field with DMORIENT_LANDSCAPE or DMORIENT_PORTRAIT.

Remeber to declare enough space to hold the DEVMODE structure in memory. All printer drivers return different lengths of due to Private data stored in the DEVMODE structure.

Once you make an update to the DEVMODE structure you will then have to call the ResetDC() API function.

Here is a link to the DEVMODE information on MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_03g2.asp


> I am using DBI-Tech's scheduler activex control and the print functions for this control do not allow the
> user to specify output orientation. As a result, the user has to select landscape each time they print
> via the printer dialogue box. Is there an API call available to turn orientation to landscape prior
> to printing and back to portrait when done?

> I have been testing John K's VBPrinter OCX (download 9588) that allows orientation control
> but it causes VFP6 to hang (using W2k).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform