Alaska Software Inc. - :setpaperbin()
Username: Password:
AuthorTopic: :setpaperbin()
Don Keating :setpaperbin()
on Tue, 31 May 2011 09:23:31 -0400
Hi Y'all,

Need some help with setting the paper bin using tdprn4()

My code:
oP:= tdcprn4():new(cDEFPRTR)
oP:setnumcopies(nCYS)
oP:setpaperbin(2) 

No matter which printer I choose or what number I assign to the
setpaperbin() parameter it always prints from the defalult bin.

All suggetions will be much appreciated.

  >don<
Joe Carrick Re: :setpaperbin()
on Tue, 31 May 2011 11:53:12 -0700
Hi Don,

I don't use td, but do you need to reconfigure the printer?

On 5/31/2011 6:23 AM, Don Keating wrote:
> Hi Y'all,
>
> Need some help with setting the paper bin using tdprn4()
>
> My code:
> oP:= tdcprn4():new(cDEFPRTR)
> oP:setnumcopies(nCYS)
> oP:setpaperbin(2)
>
> No matter which printer I choose or what number I assign to the
> setpaperbin() parameter it always prints from the defalult bin.
>
> All suggetions will be much appreciated.
>
>    >don<
Joe Carrick Re: :setpaperbin()
on Tue, 31 May 2011 12:00:40 -0700
Don,

Note: All methods in this group should only be called before a 
XbpPrinter object is associated with a presentation space. Calling them 
after an XbpPresSpace object is associated with the device context 
requires to :configure() the presentation space.

:setCollationMode() Retrieves or sets the collation mode of the current 
printer device.
:setColorMode() Sets or retrieves the mode for colored printing in 
color-capable printers.
:setDuplexMode() Sets or retrieves the mode for duplex printing
:setFontMode() Retrieves or sets the font options for this printer.
:setFormSize() Retrieves or sets the size of the output media.
:setNumCopies() Sets or retrieves the number of copies per print job.
:setOrientation() Retrieves or sets the paper orientation for a printer.
:setPaperBin() Selects the bin to load the paper from.
:setPrintFile() Set file to print to.
:setResolution() Retrieves or sets the print resolution.
:setupDialog() Activates a dialog that allows the user to select 
attributes for the print job.

td assigns the Presentation space, so you definitely would need to use 
OP:configure()



On 5/31/2011 6:23 AM, Don Keating wrote:
> Hi Y'all,
>
> Need some help with setting the paper bin using tdprn4()
>
> My code:
> oP:= tdcprn4():new(cDEFPRTR)
> oP:setnumcopies(nCYS)
> oP:setpaperbin(2)
>
> No matter which printer I choose or what number I assign to the
> setpaperbin() parameter it always prints from the defalult bin.
>
> All suggetions will be much appreciated.
>
>    >don<
Clayton Jones Re: :setpaperbin()
on Tue, 07 Jun 2011 19:54:13 -0400
Hello Joe,

>td assigns the Presentation space, so you definitely would need to use 
>OP:configure()

It is true that the Top-Town printing routines handle those mundane
chores for you.  But it is also true that they provide a space to make
assignments such as paperbin and numcopies before the presentation
space is attached.  Calling :configure() is not necessary.


Regards,
Clayton

Clayton Jones   www.cjcom.net 
 Top-Down Library for Xbase++
 X-DBU Database Utility   
 X-MEMO Memo Field Replacement
Joe Carrick Re: :setpaperbin()
on Mon, 13 Jun 2011 10:25:39 -0700
On 6/7/2011 4:54 PM, Clayton Jones wrote:
> Hello Joe,
>
>> td assigns the Presentation space, so you definitely would need to use
>> OP:configure()
>
> It is true that the Top-Town printing routines handle those mundane
> chores for you.  But it is also true that they provide a space to make
> assignments such as paperbin and numcopies before the presentation
> space is attached.  Calling :configure() is not necessary.
>
>
That's assuming that those things are set initially.  If it's being done 
after the fact then - unless td has a separate method then :configure() 
would still be needed.
Clayton Jones Re: :setpaperbin()
on Wed, 15 Jun 2011 02:50:09 -0400
Hello Joe,

>That's assuming that those things are set initially.  If it's being done 
>after the fact then - unless td has a separate method then :configure() 
>would still be needed.

I'm not sure what "after the fact" means, but if it means after the PS
is attached, then this would be true for any XbpPrinter-derived class,
not just Top-Down's.  I'm also not sure what you mean by "a separate
method".  Does "method" mean a technique or a class method?  I find
this altogether a rather confusing statement.


Please understand, the reason I responded to your initial remark...

  "td assigns the Presentation space, so you definitely would 
   need to use OP:configure()"

...was that it seems to imply that TD's printer class requires more
work (having to call :configure() when using the Set* methods) because
it handles the PS automatically.  That simply is not true and such a
statement can only have been made from ignorance of how it works.  It
makes me uneasy when someone makes incorrect statements about Top-Down
that might influence other readers' opinions of the product, so I felt
compelled to say something.

The fact is that the Set* methods must be called after the printer
object is initialized and created, but before the PS is attached. With
some thoughtful coding in the overloaded methods, TD's printer class
provides for exactly that while still handling the PS and Font
business for you.  This makes using it extremely much simpler, faster
and easier than the commonly used approaches found in the Xbase++
samples and Docs.

I hope this helps to clarify the issue.

Regards,
Clayton

Clayton Jones   www.cjcom.net 
 Top-Down Library for Xbase++
 X-DBU Database Utility   
 X-MEMO Memo Field Replacement
 NEW "X" PRODUCT (coming soon)
Joe Carrick Re: :setpaperbin()
on Sun, 19 Jun 2011 21:18:12 -0700
Clayton,

I was not implying that td required anything extra.  I was responding to 
don's post and the code that he posted.  He in fact had tried to use 
:setPaperBin() after creating the presentation space.  There was no 
intention on my part to do anything but help don.

As far as my comment about a separate method - I meant that if td has 
encapsulated the printer and presentation space in a class with its own 
class method for set paperbin, etc then maybe it also did an implicit 
"configure().  I don't know what's under the hood in td at this time.  I 
purchased it years ago and learned a lot from it - I don't use it 
because I took a different direction which is actually more "straight" 
Xbase++ with some Win API calls.

IAE, I'm sorry if you didn't understand my comments or thought that I 
was saying that there was anything wrong with td - I had no such intent.

On 6/14/2011 11:50 PM, Clayton Jones wrote:
> Hello Joe,
>
>> That's assuming that those things are set initially.  If it's being done
>> after the fact then - unless td has a separate method then :configure()
>> would still be needed.
> I'm not sure what "after the fact" means, but if it means after the PS
> is attached, then this would be true for any XbpPrinter-derived class,
> not just Top-Down's.  I'm also not sure what you mean by "a separate
> method".  Does "method" mean a technique or a class method?  I find
> this altogether a rather confusing statement.
>
>
> Please understand, the reason I responded to your initial remark...
>
>    "td assigns the Presentation space, so you definitely would
>     need to use OP:configure()"
>
> ...was that it seems to imply that TD's printer class requires more
> work (having to call :configure() when using the Set* methods) because
> it handles the PS automatically.  That simply is not true and such a
> statement can only have been made from ignorance of how it works.  It
> makes me uneasy when someone makes incorrect statements about Top-Down
> that might influence other readers' opinions of the product, so I felt
> compelled to say something.
>
> The fact is that the Set* methods must be called after the printer
> object is initialized and created, but before the PS is attached. With
> some thoughtful coding in the overloaded methods, TD's printer class
> provides for exactly that while still handling the PS and Font
> business for you.  This makes using it extremely much simpler, faster
> and easier than the commonly used approaches found in the Xbase++
> samples and Docs.
>
> I hope this helps to clarify the issue.
>
> Regards,
> Clayton
>
> Clayton Jones   www.cjcom.net
>   Top-Down Library for Xbase++
>   X-DBU Database Utility
>   X-MEMO Memo Field Replacement
>   NEW "X" PRODUCT (coming soon)
Clayton Jones Re: :setpaperbin()
on Tue, 21 Jun 2011 23:13:14 -0400
Hello Joe,

>He in fact had tried to use :setPaperBin() after creating the presentation space.  

Sorry, but that's not correct.  That's what I keep trying to explain
to you but it's not sinking in.  Here's the original code

 oP:= tdcprn4():new(cDEFPRTR)
 oP:setnumcopies(nCYS)
 oP:setpaperbin(2)

At this point the PS has not been created or attached.  This is
exactly the right place for the Set* methods (Don did find a solution
BTW, and it was unrelated to when the method was called).  


>I don't know what's under the hood in td at this time.

Exactly, which is why your statements were incorrect.


>There was no intention on my part to do anything but help don.

I know that, and I know you weren't trying to bash TD.  It's just that
your statements were incorrect due to not understanding how the TD
printer class works.  I'm just trying to set the record straight
because I don't want incorrect things being said about how TD stuff
works.  I'm not trying to bash you either, but in spite of everything
I've said you are still insisting on the same incorrect statement. Why
don't you believe me?  After all, I wrote it.  Do you think I don't
know how it works?  I know you mean well, but it's rather frustrating.



>As far as my comment about a separate method - I meant that if td has 
>encapsulated the printer and presentation space in a class with its own 
>class method for set paperbin, etc then maybe it also did an implicit 
>"configure().  

Heavens no, it's not that complicated.  SetPaperbin is not overloaded
and configure is not called anywhere because it's not needed.  And
notice that this entire idea is still based on the incorrect notion
that the PS is already attached and therefore configure is needed.  It
ain't so (how many times do I have to say it?).  

The class follows all the required steps for setting up an XbpPrinter
object, there's no black magic.  It's just organized differently, in a
way that makes it much easier and faster to use by handling the font
and PS stuff for you (plus one other major difference, but it's just a
matter of perspective).  That's all it really is, just a rearrangement
of all the normal stuff.  I don't want to give out TD's trade secrets
in public, but if you're interested in knowing how it works just have
a look at the overloaded methods in your copy.  I'm sure you'll see
what it's doing. It's very simple and straightforward, just coming at
it from a different perspective.

Let's make a deal.  I'll agree to end this thread if you'll agree to
stop insisting that setpaperbin was called after the PS was attached,
ok?  


Regards,
Clayton

Clayton Jones   www.cjcom.net 
 Top-Down Library for Xbase++
 X-DBU Database Utility   
 X-MEMO Memo Field Replacement
NEW "X" PRODUCT (coming soon)
Joe Carrick Re: :setpaperbin()
on Wed, 22 Jun 2011 21:12:08 -0700
Clayton,

I'll make this very short.  Since the code don posted was evidently 
incomplete - just the three lines - I mistakenly assumed that the first 
line assigned, created and attached the presentations space.

If you had simply stated that this was not true and that the subsequent 
code - unpublished - was required to attach it then I would have 
understood and said no more.

IAE, I'm Sorry to have offended you - obviously I have - but I'm not 
sure why you need to be defensive.  Rest assured that in thre future I 
will not respond to any posts regarding anything to do with TD.

-Joe
Clayton Jones Re: :setpaperbin()
on Fri, 24 Jun 2011 13:18:27 -0400
Hello Joe,

>If you had simply stated that this was not true...

I did, several times... 

 From my 1st post: "Calling :configure() is not necessary."
 From my 2nd post: "That simply is not true..."
 From my 3rd post: "Sorry, but that's not correct."

...but for some reason you continued to ignore what I was saying.
That's the real mystery for me.  This entire extended thread was
unnecessary.


>...and that the subsequent code - unpublished - was required to attach it 
>then I would have understood and said no more.

It didn't occur to me that I needed to spell it out in more detail.
If you didn't understand it, instead of ignoring what I was saying and
repeating your assertions, you could have asked for clarification.  


>I'm not sure why you need to be defensive

If "defensive" means not wanting incorrect things to be said about my
software in a public forum, and wanting to set the record straight,
then I guess I'm guilty of that. 



>I'm Sorry to have offended you - obviously I have 

I am not offended, nor am I mad at you (only a bit frustrated at
having to go through all this).  As I stated before, I am not
attacking you personally and my only interest in this has been to
ensure that incorrect statements are not made about TD.  From the
beginning all I have been trying to do is set the record straight
about your comments.   

Please, let's end this.


Regards,
Clayton

Clayton Jones   www.cjcom.net 
 Top-Down Library for Xbase++
 X-DBU Database Utility   
 X-MEMO Memo Field Replacement
NEW "X" PRODUCT (coming soon)
Joe Carrick Re: :setpaperbin()
on Tue, 31 May 2011 12:03:09 -0700
BTW, you should use a returned value from :getpaperbins().  Take a look 
at the Xbase++ docs for :setpaperbin()
Don Keating Re: :setpaperbin()
on Tue, 31 May 2011 17:34:06 -0400
Joe,

Thanks for the responses.  Much food for thought as soon as I get back to
this project.

Have been sidetracked temporily.

  >don<

On Tue, 31 May 2011 12:03:09 -0700, Joe Carrick wrote:

> BTW, you should use a returned value from :getpaperbins().  Take a look 
> at the Xbase++ docs for :setpaperbin()
Don Keating Re: :setpaperbin()
on Wed, 01 Jun 2011 11:45:10 -0400
I'm Baaaaack!

Thanks Joe and Jimmy for the jump start!

This works for me to let user select the bin when he doesn't want the
default.

aBIN1:= oP:paperbins()
for nK:= 1 to len(aBIN1)
   aadd(aBIN2,aBIN1[nK,2])  Need only name to show user
next
nEL:= tdachoose(aBIN2,len(aBIN2),,;
            "Choose Paper Source",,,,,,,,,,,,,{tdBLK,tdORN})
if nEL== 0  ;  return  ;  endif
oP:setpaperbin(aBIN1[nEL,1])


   >don<




On Tue, 31 May 2011 17:34:06 -0400, Don Keating wrote:

> Joe,
> 
> Thanks for the responses.  Much food for thought as soon as I get back to
> this project.
> 
> Have been sidetracked temporily.
> 
>   >don<
> 
> On Tue, 31 May 2011 12:03:09 -0700, Joe Carrick wrote:
> 
> > BTW, you should use a returned value from :getpaperbins().  Take a look 
> > at the Xbase++ docs for :setpaperbin()
AUGE_OHRRe: :setpaperbin()
on Tue, 31 May 2011 23:33:32 +0200
hi,

> oP:setpaperbin(2)

are you shure about your Printer = 2 ( XBPPRN_PAPERBIN_LOWER ) ?

if you add a 2nd Paperbin at Bottum it might be XBPPRN_PAPERBIN_MIDDLE
so have a look into your Printer Driver Property about PaperBin Number.

for a HP DL 2055dn i have to use total different PaperBin Number

      IF oDC:paperBins() != NIL
         aPB := oDC:paperBins()           Array of PaperBins
         iMax := LEN( aPB )
            
             HP P2055dn
            
            IF "P2050" $ cPrinter                 HP LaserJet P2050 Series 
PCL6
               FOR i = 1 TO iMax
                  nDummy := aPB[ i ] [ 1 ]
                  DO CASE
                     CASE nPaperBin == XBPPRN_PAPERBIN_CASETTE
                        IF nDummy == 260
                           nPaperBin := 260
                            EXIT
                        ENDIF
                     CASE nPaperBin == XBPPRN_PAPERBIN_MIDDLE
                        IF nDummy == 261
                           nPaperBin := 261
                            EXIT
                        ENDIF
                  ENDCASE
               NEXT
            ELSE
               FOR i = 1 TO iMax
                  nDummy := aPB[ i ] [ 1 ]
                  IF nDummy == nPaperBin
                     EXIT
                  ENDIF
               NEXT
            ENDIF

greetings by OHR
Jimmy