Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 15 FEB 1998 04:11:23PM Jeff Hilb wrote:

How can I programatically print in landscape without having to being up the printer dialog to the user? The only way I have been able to find this is to bring up the printer dialog?

Jeff Hilb


At 16 FEB 1998 10:47AM Don Bakke wrote:

Jeff,

What are you using to print?

[email protected]

SRP Computer Solutions


At 16 FEB 1998 02:25PM Cameron Revelation wrote:

Jeff,

How can I programatically print in landscape without having to being up the printer dialog to the user? The only way I have been able to find this is to bring up the printer dialog?

In 3.5, the PrintSetup utility is included in source format. Additionally, this thread may answer a question or two.

Cameron Purdy

[email protected]


At 16 FEB 1998 05:51PM Don Bakke wrote:

Cameron,

In 3.5, the PrintSetup utility is included in source format

I looked at this source before I responded earlier and near as I can tell the only thing PrintSetup will do is bring up the printer's dialog box and allow you to make changes to the print setup this way. Is there anything more direct without the use of dialog boxes that can be used?

Jeff, if you are reading this, the closest way I know of is through the OIPI but I don't know if print setup changes are permanent or only affect the current print job (which assumes that the OIPI is doing the printing). Perhaps you can launch the OIPI, set to landscape, print whatever you were originally printing, then close the OIPI.

[email protected]

SRP Computer Solutions


At 16 FEB 1998 06:30PM Cameron Revelation wrote:

Don

I looked at this source before I responded earlier and near as I can tell the only thing PrintSetup will do is bring up the printer's dialog box and allow you to make changes to the print setup this way. Is there anything more direct without the use of dialog boxes that can be used?

Look at PrintSetup_Equates:

<code>
equ PRN_GET$             to 2     ;* get list of printers
equ PRN_SET$             to 3     ;* set current (ie. default) printer

</code>

The corresponding code in PrintSetup() will programmatically return a list of printers and set a printer. If you add a printer using the Windows control panel printer setup, configure the printer for landscape, and then use the PRN_SET$ option, you can change to landscape "on the fly".

Cameron Purdy

[email protected]


At 16 FEB 1998 08:32PM Jeff Hilb wrote:

Ok, I suppose that will work (adding a printer). But I was looking for something more direct like a command. But that'll do it too.

Thanks everyone,

Jeff


At 16 FEB 1998 10:42PM Don Bakke wrote:

Cameron,

The corresponding code in PrintSetup() will programmatically return a list of printers and set a printer. If you add a printer using the Windows control panel printer setup, configure the printer for landscape, and then use the PRN_SET$ option, you can change to landscape "on the fly".

I'll admit I hadn't thought of this approach, which is a bit clever. However, will this work in Win 3.x? I'm not sure that one can add multiple print drivers for the same printer.

Also, if I understand this approach, wouldn't this require a different printer added for every possible configuration combination (i.e. paper size, margins, orientation, etc.) Granted Jeff only wanted to know how to switch to landscape but in the bigger picture how would/could we modify any printer setup programmatically?

As always, thanks,

[email protected]

SRP Computer Solutions


At 17 FEB 1998 07:32AM Cameron Revelation wrote:

Don,

Granted Jeff only wanted to know how to switch to landscape but in the bigger picture how would/could we modify any printer setup programmatically?

I honestly don't know. I haven't worked with Windows printing much. Some switches are available only via the driver's UI and some (the more common ones) are available programmatically.

… I looked … the DEVMODE structure used to create a device context (hDC) for the printer contains a field

<code>
dmOrientation	Specifies the orientation of the paper. It can be either DMORIENT_PORTRAIT or DMORIENT_LANDSCAPE.

</code>

Supporting this for the PRINT statement would definitely require a change to the engine. I am not even certain that we could support it with the other options that PRINT supports, such as the escape pass-through option.

Cameron Purdy

[email protected]

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/ad6def6222e05108852565ac0074664d.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1