Antonio: Duplexprint

Antonio: Duplexprint

Postby byte-one » Sun Feb 14, 2016 2:07 pm

In the source printdc.c in function HB_FUNC( PRNDUPLEX ) // ( nValue ) --> nOldValue should be added the line
Code: Select all  Expand view
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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Duplexprint

Postby Antonio Linares » Sun Feb 14, 2016 5:50 pm

Günther,

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

thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Duplexprint

Postby byte-one » Sun Feb 14, 2016 6:26 pm

My code for a new function IsDuplexPrinter():
Code: Select all  Expand view
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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Duplexprint

Postby Antonio Linares » Sun Feb 14, 2016 7:58 pm

Günther,

Included for the next FWH version :-)

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Duplexprint

Postby byte-one » Sun Feb 14, 2016 10:00 pm

Antonio, perfect!
Thanks!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Duplexprint

Postby byte-one » Thu Mar 03, 2016 2: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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Duplexprint

Postby Antonio Linares » Fri Mar 04, 2016 7:22 am

Günther,

Have you implemented them ?

If so, please share the code, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Duplexprint

Postby byte-one » 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: Select all  Expand view
METHOD Setduplex( nMode ) CLASS TPreview
if ISDUPLEXPRINTER()
    PRNDUPLEX( nMode )
    ::oDevice:Rebuild()
endif
return NIL
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Duplexprint

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Duplexprint

Postby byte-one » Tue Mar 08, 2016 3:59 pm

Antonio, screenshoot from my preview dialog.

Image
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests