Sorry for the delay. I finally had the chance to test this. Here is what I have found:
1) I can use PRNDUPLEX( 1 ) to set the printer to one side only
2) I can use PRNDUPLEX( 2 ) or ( 3 ) to print both sides ( duplex ). HOWEVER, it prints incorrectly. Either 2 or 3 will print the same. It is called "short edge binding" and it means that with a single sheet, you rotate it vertically to see the other side properly. (2) should use long edge binding. That means on page one, if you hold the left side and flip the page to the left, the back side will have the print top at the same top of the sheet as the front.
3) I also find if I send it to the printer from the View mode, it works. If I send it directly to the printer, it does not work. In other words, in the print selection dialog, FROM USER needs to be selected, and just sending to the default printer does not trigger duplex printing.
We have no provision for passing this value in the tPrinter class. We can pass mode ( portrait or
landscape ), number of copies, and more, but we cannot pass the Duplex setting. Since all of my reports are built with the tPrinter class, this would be a very useful addition. I think this would solve the issue in #3 above.
I DID FURTHER RESEARCH:
Here is the PRNDUPLEX code from FW:
- Code: Select all Expand view RUN
HB_FUNC( PRNDUPLEX ) // ( nValue ) --> nOldValue
{
LPDEVMODE lpDevMode;
int dmDuplex;
PrinterInit();
lpDevMode = (LPDEVMODE) GlobalLock( pd.hDevMode );
dmDuplex = lpDevMode->dmDuplex;
if( hb_pcount() > 0 )
lpDevMode->dmDuplex = hb_parni( 1 );
hb_retni( dmDuplex );
GlobalUnlock( pd.hDevMode );
}
Note that is does not take the value passed. So apparently the command defaults to "short side binding". I'm not sure who would use that one (3). We need to use long edge binding ( 2 ).
Yes, it would be nice to see this incorporated, with proper options, in the tPrinter class ( printer.prg )
Antonio ????