Changing Printer Bins

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Changing Printer Bins

Postby IDEAL Software Support » Thu Nov 18, 2004 6:54 pm

Using VPE Professional ver 3.2 release 4
Visual Foxpro 6.0 SP4 - Windows 2000 or XP

.device=pprinter
.devpaperbin=iif(pbin>0,pbin,1)
.printdoc(.f.)
.closedoc

I am using the above commands to attempt to make the printer automatically switch printer bins.

This works on our HP LaserJet 4 Plus which has the add on large capacity bin. The client has an HP LaserJet 4100 with PCL6 (a 4 bin printer) attached to a Win 2000 server. When we select the manual paper feed, the printer pauses and displays a message to insert paper. But when we try to print to letterhead paper in Tray 3, the printer still prints on blank paper from the default tray. FYI on the HP 4100 tray 3 is assigned bin number 11. This is the same number as the large capacity bin on the HP4 Plus.

Any idea what I need to do to get the printer to recognize the bin switch?
Bob Loree
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby IDEAL Software Support » Thu Nov 18, 2004 6:55 pm

You should not use DevPaperBin, always use the PaperBin property. See the following comment from the help file in the explanation of DevPaperBin:

"The DevPaperBin property is available for total control. It is only useful if called while processing the BeforePrintNewPage() event (VCL: OnPrintNewPage()). Otherwise the DevPaperBin is always overridden by the PaperBin property. You should always use the PaperBin property to change the bin for the printer."

You can also try to use VPE v3.50 it contains some enhanced code, so VPE can switch paperbins according to page dimensions in the VPE document and corresponding paper sizes in the different bins.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby IDEAL Software Support » Thu Nov 18, 2004 6:57 pm

I changed to the following based on your note.

.OpenDoc
.AutoBreakMode = AUTO_BREAK_ON
.SelectFont("Courier New", 11)
.PageOrientation=1 &&portrait
.PaperBin=iif(pbin>0,pbin,1)

The paperbin property also did not work with either the HP LaserJet 4 Plus or the HP4100. The form still printed to the default bin. Is there some magic order for the commands? Do I need to select the device before setting the Bin? The page orientation works if changed in the above example.

I am setting the paperbin property = to the value rather than vbin_lower or vbin_largecapacity, but it doesn't seem like that should make a difference.

Also what happens if you set the bin, then preview and select a printer that doesn't have the specified bin?

Bob
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby IDEAL Software Support » Thu Nov 18, 2004 6:58 pm

>>
I am setting the paperbin property = to the value rather than vbin_lower or vbin_largecapacity, but it doesn't seem like that should make a difference.
<<

It makes a huge difference. Excerpt from the help file:

>>
Do not rely on the bin names of the constants, like VBIN_UPPER, etc. - their names might not match correctly a tray: for example under WinNT for an HP 5P you can select the lower tray with VBIN_LOWER and the upper tray with VBIN_UPPER, but under Win95 for the same printer you can only use VBIN_MANUAL for the upper tray and VBIN_UPPER for the lower tray (yes, it is not a mistake: the LOWER tray is selected with VBIN_UPPER!).
Solution: operate with BIN-ID's and the corresponding bin names only, see DevEnumPaperBins and ff.
<<

So where do you get your "pbin" value from? Use DevEnumPaperBins to retrieve the bin-values the printer really understands.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby IDEAL Software Support » Thu Nov 18, 2004 6:59 pm

I wrote a form for the user to select the printer and bin number and save it in a database of their forms. I do use devenumpaperbins to display all the valid bins for the printer and to get the bin number to store for the form. In this particular application all computers are running Win 2000 and using the HP PCL6 driver on the win 2000 server. But from what you say in other environments that may mix versions of Windows using the bin number will not work. Is that correct? Or is bin 11 always the large capacity bin for a Laserjet 4 plus regardless of the version of windows?

It appears to be working on my 4 plus and it appears to be working on the 4100TN we will be doing some more testing this afternoon and let you know.

Thanks.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby IDEAL Software Support » Thu Nov 18, 2004 7:03 pm

>>
Or is bin 11 always the large capacity bin for a Laserjet 4 plus regardless of the version of windows?
<<

We have not especially tested this printer driver. But from our experience you should not rely on any Windows bin names and their constants. We recommend to operate only with BIN-ID's and the corresponding bin names, which have been retrieved using DevEnumPaperBins() and the associated properties / methods.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 38 guests

cron