Loading...

Print tray selection issue

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Print tray selection issue

Postby LotusGuy » Fri Jan 04, 2008 7:36 am

I set a specific print tray in my code but it is random on whether the system will use the right tray. It will for some prints and others it will use the default tray. Below is my code:

Code: Select all
Function printShippingLabelE(path As String) As Boolean
   
   Dim tray As Long
   tray = 4
   Dim oGdPicture As Variant
   Set oGdPicture = CreateObject("gdpicturepro4.imaging")
   
   oGdPicture.SetLicenseNumber("XXXXXXXXXXXXXXXXXXXXXXXXX")
   
   Dim xRef1 As Long
   xRef1 = oGdPicture.CreateImageFromFile(path)
   oGDPicture.SetNativeImage(oGDPicture.getNativeImage())
   Call oGDPicture.PrintSetCopies(1)
   Call oGDPicture.Rotate(1)
   Call oGdPicture.PrintSetPaperBin(tray)
   Call oGdPicture.PrintImageBySize (30, 153, 152, 102)
   
   printShippingLabelE = True
   Kill path
   
End Function


Any insight would be appreciated

Keith
LotusGuy
 
Posts: 14
Joined: Mon Dec 03, 2007 4:42 am

Re: Print tray selection issue

Postby Loïc » Fri Jan 04, 2008 11:40 am

Hi Keith,

You are using the PRBNManual value as parameter for the SetPaperBin method.
This indicates that the printer will use the first bin containing a sheet of paper. In this case, it is not a specific print tray.

You need to use one of the other values:

1: PRBNUpper : Using the upper bin
2: PRBNLower : Using the lower bin
3: PRBNMiddle : Using the middle bin
4: PRBNManual : Insert a sheet of paper
5: PRBNEnvelope : Using the envelope feeder
6: PRBNEnvManual : Insert an envelope
6: PRBNAuto : Using the default paper bin
8: PRBNTractor : Using the tractor feeder
9: PRBNSmallFmt : Using the small paper feeder
10: PRBNLargeFmt : Using the large paper feeder
11: PRBNLargeCapacity : Using the large capacity feeder
14: PRBNCassette : Using the attached cassette cartridge



Regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Print tray selection issue

Postby LotusGuy » Sat Jan 05, 2008 5:48 am

Looks liked that worked. I was associating "manual" with the manual input tray on my printer...

Thanks!

Keith
LotusGuy
 
Posts: 14
Joined: Mon Dec 03, 2007 4:42 am

Re: Print tray selection issue

Postby LotusGuy » Sun Jan 06, 2008 1:17 am

Ok.. after further testing it looks like that no matter what tray i choose, it will only use the first one for the entire session. I need to print to the upper tray to print a label first then print the rest of the document.

New test code below:

Code: Select all
Function printShippingLabelE(path As String) As Boolean
   
   Dim oGdPicture As Variant
   Set oGdPicture = CreateObject("gdpicturepro4.imaging")
   
   oGdPicture.SetLicenseNumber("XXXXXXXXXXXXXXXXXXXXXXXXX")
   
   Dim xRef1 As Long
   xRef1 = oGdPicture.CreateImageFromFile(path)
   oGDPicture.SetNativeImage(oGDPicture.getNativeImage())
   Call oGDPicture.PrintSetCopies(1)
   Call oGDPicture.Rotate(1)

   'print to upper tray
   Call oGdPicture.PrintSetPaperBin(1)
   Call oGdPicture.PrintImageBySize (30, 153, 152, 102)

   'then to lower tray
   Call oGdPicture.PrintSetPaperBin(3)
   Call oGdPicture.PrintImageBySize (30, 153, 152, 102)
   
   printShippingLabelE = True
   Kill path
   
End Function


Unfortunately, this is a show stopper for me.

Thanks,
Keith
LotusGuy
 
Posts: 14
Joined: Mon Dec 03, 2007 4:42 am

Re: Print tray selection issue

Postby Loïc » Sun Jan 06, 2008 9:30 pm

Hi Keith,

You printer driver seems to doesn't associate the value 3 to the middle bin.

In a first time I suggest you to catch all supported values by your printer driver:

Code: Select all
Dim nCpt As Long
Dim sSupportedBin As Long

For nCpt = 0 To 2 ^ 8
    Call Imaging1.PrintSetPaperBin(nCpt)
    If Imaging1.PrintGetPaperBin = nCpt Then sSupportedBin = sSupportedBin & " " & str(nCpt)
Next nCpt

MsgBox sSupportedBin


In a second time, you have to determine what is the good value to use in order to print to the middle paper bin.

Best regards,

Loïc Carrère
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Print tray selection issue

Postby LotusGuy » Wed Jun 02, 2010 2:24 am

Loic,

Since this thread, I have aquired a new printer (HP 9050dn) and I cannot address any of the trays on that machine. Using the interation code, the only tray supported returns code 15.

Is there a driver setting or software setting that I need to use to make this work again?

Thanks,
Keith
LotusGuy
 
Posts: 14
Joined: Mon Dec 03, 2007 4:42 am

Re: Print tray selection issue

Postby LotusGuy » Sun Jun 06, 2010 6:03 pm

OK... I think I may have figured this one out... apparently, the HP drive shows the trays as numbers above 256. I was able to address the trays using those numbers in the "custom" range.

Hope this saves someone else several hours worth of work... :)

Thanks,
Keith
LotusGuy
 
Posts: 14
Joined: Mon Dec 03, 2007 4:42 am


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest