FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Antonio: Duplexprint
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Antonio: Duplexprint
Posted: Sun Feb 14, 2016 02:07 PM
In the source printdc.c in function HB_FUNC( PRNDUPLEX ) // ( nValue ) --> nOldValue should be added the line
Code (fw): Select all Collapse
if (pDevMode->dmFields & DM_DUPLEX)
to set any nValue only if the duplexprint for the printer is present.

Or a second way == better: A separated function IsDuplexprinter() similar to IsColorprinter()
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Duplexprint
Posted: Sun Feb 14, 2016 05:50 PM

Günther,

Please post the entire source code of your modified HB_FUNC( PRNDUPLEX )

thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Duplexprint
Posted: Sun Feb 14, 2016 06:26 PM
My code for a new function IsDuplexPrinter():
Code (fw): Select all Collapse
HB_FUNC( ISDUPLEXPRINTER )
{
   LPDEVMODE  lpDevMode;

   PrinterInit();

   lpDevMode  = (LPDEVMODE) GlobalLock( pd.hDevMode );

   hb_retl( pDevMode->dmFields & DM_DUPLEX );
   GlobalUnlock( pd.hDevMode );
}

If this function return .T. the PRNDUPLEX() can set a duplex-mode.
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Duplexprint
Posted: Sun Feb 14, 2016 07:58 PM

Günther,

Included for the next FWH version :-)

many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Duplexprint
Posted: Sun Feb 14, 2016 10:00 PM

Antonio, perfect!
Thanks!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Duplexprint
Posted: Thu Mar 03, 2016 02:25 PM

Antonio, the methods setduplexnone() , setduplexlong() , setduplexshort() or a single method should add to printer.prg! (with check to duplex Y/N with the new function)

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Duplexprint
Posted: Fri Mar 04, 2016 07:22 AM

Günther,

Have you implemented them ?

If so, please share the code, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Duplexprint
Posted: Fri Mar 04, 2016 10:47 AM
Antonio, i have do this in rpreview and insert radios on the print-side dialog:
Parameters are 1==none duplex, 2==duplex long side, 3==duplex short side
But not all printers with ISDUPLEXPRINTER()==.T. can really print duplex!

Code (fw): Select all Collapse
METHOD Setduplex( nMode ) CLASS TPreview
if ISDUPLEXPRINTER()
    PRNDUPLEX( nMode )
    ::oDevice:Rebuild()
endif
return NIL
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Duplexprint
Posted: Tue Mar 08, 2016 11:08 AM

Günther,

> i have do this in rpreview and insert radios on the print-side dialog

Could you post a screenshot of the dialog ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Duplexprint
Posted: Tue Mar 08, 2016 03:59 PM
Antonio, screenshoot from my preview dialog.

Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion