Printing, switching paperbins

This forum is for general support of Xbase++
Post Reply
Message
Author
HRoesch01
Posts: 3
Joined: Thu Feb 10, 2011 10:20 am

Printing, switching paperbins

#1 Post by HRoesch01 »

Hi all!

I need to switch paperbins when printing copies.
The logic is as follows: The first copy shall go to
bin 1, all following copies shall go to bin 2.

I tried to implement this in tdcprv3:PrintSeg
in the for k=1 to ::numCopies-loop. But the
printer does not react at all to my setPaperBin (nBin)
statement, it simply prints to standard bin.

Any hints appreciated!

Greetings

Heinz

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Printing, switching paperbins

#2 Post by rdonnay »

Before calling :setPaperBin() you must first call :endPage(), then after calling :setPaperBin() to must call :startPage().
The eXpress train is coming - and it has more cars.

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: Printing, switching paperbins

#3 Post by RDalzell »

Heinz,

tdcprv3 is a TopDown command, best to ask Clayton directly.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Printing, switching paperbins

#4 Post by Auge_Ohr »

HRoesch01 wrote:o:setPaperBin (nBin)
#Define in c:\ALASKA\XPPW32\Include\xbpdev.ch must not "match" your Printer.

use o:paperBins() to find out if #Define "match" your Printer
this it a HP 2055dn Printer with 2nd Paper Tray
HP_Paperbin.JPG
HP_Paperbin.JPG (18.13 KiB) Viewed 11167 times
greetings by OHR
Jimmy

HRoesch01
Posts: 3
Joined: Thu Feb 10, 2011 10:20 am

Re: Printing, switching paperbins

#5 Post by HRoesch01 »

Hi Roger!
rdonnay wrote:Before calling :setPaperBin() you must first call :endPage(), then after calling :setPaperBin() to must call :startPage().
Yeah, that did the trick! Thank you for fast and excellent support, as usual!

Since the exact sequence of print methods is of critical importance,
i would like to present the final solution. Just in case someone has
a client, that needs this special type of printing. :mrgreen:

Greetings

Heinz

Code: Select all

IF lPrint
   nCopies := ::nNumCopies
   ::tdcprn3:SetNumCopies (1)

   ******* Give PS to printer object
   ::oPS:mode := XBPPS_MODE_NORMAL
   ::oPs:configure(self)
   ::oPs:setfont(::oFont)

   FOR k := 1 TO nCopies
      if k == 1
         // erste Kopie auf Schacht 1
         nBin := GetPaperBin (::tdcPrn3:DevName, 1)
         if TestMode ()
            alert ("Schacht 1: " + str (nBin))
         endif
         if ! empty (nBin)
            ::tdcPrn3:endPage ()
            ::tdcPrn3:SetPaperBin (nBin)
            ::tdcPrn3:startPage ()
         endif
      else
         // folgende Kopien auf Schacht 2
         nBin := GetPaperBin (::tdcPrn3:DevName, 2)
         if TestMode ()
            alert ("Schacht 2: " + str (nBin))
         endif
         if ! empty (nBin)
            ::tdcPrn3:endPage ()
            ::tdcPrn3:SetPaperBin (nBin)
            ::tdcPrn3:startPage ()
         endif
      endif

      ******* begin output
      ::tdcPrn3:startdoc(cJob)

      IF cMode == 'all'

         nLen := len(::aSegments)
         FOR i := 1 TO nLen
            GraSegDraw(::oPs,::aSegments[i])
            IF i < nLen
               ::tdcPrn3:newpage()
            ENDIF
         NEXT

      ELSEIF cMode == 'curr'
         ******* print current segment
         GraSegDraw(::oPs,::nSeg)

      ELSEIF cMode == 'range'

         FOR i := nP1 TO nP2
            GraSegDraw(::oPs,::aSegments[i])
            IF i < nP2
               ::tdcPrn3:newpage()
            ENDIF
         NEXT

      ENDIF

      ******* end output
      ::tdcPrn3:endDoc()
   NEXT

   ******* Take back PS from printer object
   ::oPS:mode := XBPPS_MODE_HIGH_PRECISION
   ::oPS:configure(::oPage:windevice())
   ::oPS:setfont(::oFont)

   ******* reset PS color attribute
   ::oPS:SetAttrArea(::aAreaAttr)

   ******* resize vp
   ::calcVP(@vnX,@vnY,@vnX2,@vnY2)
   ::oPs:setViewPort({vnX,vnY,vnX2,vnY2})

   ::lPrinted := .T.

ENDIF  // lPrint

HRoesch01
Posts: 3
Joined: Thu Feb 10, 2011 10:20 am

Re: Printing, switching paperbins

#6 Post by HRoesch01 »

Hi Jimmy!
Auge_Ohr wrote:#Define in c:\ALASKA\XPPW32\Include\xbpdev.ch must not "match" your Printer.
Yes, i know. Windows chaos, as usual! :mrgreen:

Since we do not need that very often i have a support
function in our software that alerts the paperBins()-data
for any choosable printer.

The supporter than feeds back the chosen bins by use
of simple system variables. Not too elegant, but it works!

Greetings

Heinz

Post Reply