Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing text files in landscape/portrait mode
Message
 
To
29/09/1998 03:37:12
Teo Kock Hin
Singapore Press Holdings
Singapore, Singapore
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00141791
Message ID:
00142232
Views:
23
>hi all,
>
>Currently I'm using the following procedure to print text files.
>(1) load text file into a rich-text control (rtf)
>(2) set rtf font name and size
>(3) display printer dialog using ActiveX common control dialog
>(4) flags 0x100 (256) is use to return the hDC property
>(5) user MUST set the landscape/portrait mode for the loaded file
>(6) the file is printed using rtf.SelPrint(hDC)
>
>So far so good, only problem is that I want to programmatically
>set the landscape/portrait mode, paper size, etc without bringing
>up the printer dialog and lets the user select them.
>
>There must be a way to do it in VFP. Any solution or help is much
>appreciated.
>
>Thank you.
>Kockhin

Hi,

This type of operation can be done via the SetPrinter() API function. It, unfortunately, would require that you send a PRINTER_INFO_2 structure to set the orientation. This structure contains a pointer to a DEVMODE structure that's one of its members. While I'm playing around with the GetPrinter() function, I'm not far enough along in the process to say whether or not it's possible in native FoxPro code to either access or set the values associated with this (PRINTER_INFO_2) structure (there are four other PRINTER_INFO structures).

It also might be possible to set this information in the registry's Default DevMode entry for the particular printer.

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform