Printing double sided

Re: Printing double sided

Postby TimStone » Tue Oct 25, 2022 7:01 pm

I saw that after my last post, but the question becomes, how is it passed ?

C is not my strength ... but is PRNDUPLEX( 2 ) really passing the specific value correctly ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Printing double sided

Postby Antonio Linares » Tue Oct 25, 2022 9:42 pm

Dear Tim,

function PRNDUPLEX() just uses one parameter and it is properly assigned here:

lpDevMode->dmDuplex = hb_parni( 1 );
regards, saludos

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

Re: Printing double sided

Postby TimStone » Tue Oct 25, 2022 9:57 pm

Antonio,

The the problem persists. The use of 1 outputs to just one side of the page ( correctly ).

Option 2 or 3 result in the same short side binding. One of them should be short side, and the other long side ( preferred but does not occur ).
I checked the referenced Microsoft site, Googled the process, etc, and it should work. However, in testing ( multiple times ) it doesn't. I always get short sided binding with either 2 or 3 .

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Printing double sided

Postby nageswaragunupudi » Wed Oct 26, 2022 8:45 am

Enrico Maria Giordano wrote:
TimStone wrote:Note that is does not take the value passed.


Yes, it does:

Code: Select all  Expand view
lpDevMode->dmDuplex = hb_parni( 1 );


Or am I missing something?


You are right.
Code: Select all  Expand view
nPrevMode := PRNDUPLEX( nNewMode )

woks perfectly.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Printing double sided

Postby nageswaragunupudi » Wed Oct 26, 2022 2:05 pm

Code: Select all  Expand view

/* duplex enable */
#define DMDUP_SIMPLEX    1
#define DMDUP_VERTICAL   2
#define DMDUP_HORIZONTAL 3
 


In portait mode, if we want to stitch/staple the book on left side (long edge), use DMDUP_VERTICAL(2), otherwise (very uncommon) if we plan to staple on the top (short side) then use DMDUP_HORIZONTAL(3)

In case of landscape printing, if we want to staple the book on left side (short edge) then use DMDUP_HORIZONTA( 3 ), or if we want to staple on the top (long edge) use DMDUP_VERTICAL(2).

I have tested all and working well.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Printing double sided

Postby TimStone » Wed Oct 26, 2022 4:25 pm

At what point are you issuing the command ? Are you passing it as a numeric ( 2 ) or string ( "2" ).

Code: Select all  Expand view

 // Present the print selection option window and find the type
   nPrnOpt := PRNSEL()
   IF nPrnOpt = 0                               // If Exit is specified, leave the print report function
      RETURN NIL
   ENDIF

   // Now tell the print engine the type of format to use
   IF nPrnOpt = 1
      PRINT oPrn NAME "Workorder Printing" PREVIEW FROM USER MODAL // Preview with alternate printer selection
   ELSEIF nPrnOpt = 2
      PRINT oPrn NAME "Workorder Printing" PREVIEW MODAL // Preview with default printer
   ELSEIF nPrnOpt = 3
      PRINT oPrn NAME "Workorder Printing" FROM USER // Send to user selected printer
   ELSEIF nPrnOpt = 4
      PRINT oPrn NAME "Workorder Printing"      // Send to default printer
   ENDIF


   // ?????????  HERE ??????????
   PRNDUPLEX( 2 )



   // Define the brush
   // Set the resolution divided by the standard 8.5x11 inch paper rows/columns
   nRsp := oPrn:nVertRes() / 68                 // Number of rows
   nCsp := oPrn:nHorzRes() / 85                 // Number of columns
   // Now send the number of copies to the printer
   oPrn:SetCopies( nPrnCopies )
 
   // Turn on the first page - print the header data
   PAGE
   WOHEADER( oPrn, aHead )
....

   // End of print
   ENDPAGE
   oPrn:SetCopies( 1 )
   ENDPRINT
 


The ... represent actions like setting fonts, brushes, colors, and printing the individual lines of output.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Printing double sided

Postby TimStone » Wed Oct 26, 2022 10:03 pm

This may be an issue with my printer. If I use the option to select a printer, and in that Windows setup control select the proper output ( long binding ), it still comes out the same way. I can let it ride for now ...
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Printing double sided

Postby nageswaragunupudi » Thu Oct 27, 2022 12:57 am

Code: Select all  Expand view

PRINT ....
// Anywhere between PRINT between ENDPRINT
nSaveDuplex := PRNDUPLEX(  2 or 3 )
// ...
// ...
ENDPRINT
PRNDUPLEX( nSaveDuplex )
 

I am using Numeric value.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Printing double sided

Postby TimStone » Thu Oct 27, 2022 1:08 am

That is what I’vve done so I will leave it in. The output is wrong on my printer but hopefully client printers will be good. Thank you


Sent from my iPhone using Tapatalk
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Printing double sided

Postby nageswaragunupudi » Thu Oct 27, 2022 1:31 am

That is what I’vve done so I will leave it in. The output is wrong on my printer but hopefully client printers will be good. Thank you

Let us try again your tomorrow.
Please post a small self contained program.
Let us also add this
Code: Select all  Expand view
if ISDUPLEXPRINTER()
   PRNDUPLEX( n )
endif
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 86 guests