Select the printer tray using the Java Print Service with JDK 1.4.2

Hello,
I have got a problem with 1.4 Printing. I would like to specify the printer tray for printing on Windows platform (XP and NT4.0). I am trying to use the attribute javax.print.attribute.standard.MediaTray class (ex. MediaTray.BOTTOM).
Howerver, I can control the printer tray if I use the PCL driver of the printer. If I user the postscript driver I am not able to control the printer tray. I can reproduce the problem with 3 different printers (HP, Lexmark and Nashuatec).
I used the getSupportedAttributeValues to check the supported values of the Media
Media med[] = (Media[])service.getSupportedAttributeValues(Media.class, null, null);
for (int k=0; k<med.length; k++) {
System.out.println("Name : " + med[k].getClass() + " - Value : " + med[k].getValue());     
With the PCL driver I have the following output and I can control the printer tray.
Name : class javax.print.attribute.standard.MediaTray - Value : 0
Name : class javax.print.attribute.standard.MediaTray - Value : 2
Name : class javax.print.attribute.standard.MediaTray - Value : 4
Name : class sun.print.Win32MediaTray - Value : 0
Name : class sun.print.Win32MediaTray - Value : 1
With the postscript driver I have the following output and I cannot control the printer tray
Name : class sun.print.Win32MediaTray - Value : 5
Name : class sun.print.Win32MediaTray - Value : 6
Name : class sun.print.Win32MediaTray - Value : 7
Name : class sun.print.Win32MediaTray - Value : 8
Name : class sun.print.Win32MediaTray - Value : 9
As I must use the postscript printer, can someone help me?
Thanks.

Hello,
Can you tell me how it's possible to selet the tray using the PCL?
I print on the following way:
PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
AttributeSet aset = new HashAttributeSet();
aset.add(new PrinterName("\\\\107208\\SBE08111", null)); // select printer
......Now I tried to add your code and I get the following output:
0: Name : class javax.print.attribute.standard.MediaSizeName - Value : 40
1: Name : class javax.print.attribute.standard.MediaSizeName - Value : 41
2: Name : class javax.print.attribute.standard.MediaSizeName - Value : 45
3: Name : class javax.print.attribute.standard.MediaSizeName - Value : 42
4: Name : class javax.print.attribute.standard.MediaSizeName - Value : 4
5: Name : class javax.print.attribute.standard.MediaSizeName - Value : 5
6: Name : class javax.print.attribute.standard.MediaSizeName - Value : 27
7: Name : class javax.print.attribute.standard.MediaSizeName - Value : 46
8: Name : class javax.print.attribute.standard.MediaSizeName - Value : 59
9: Name : class javax.print.attribute.standard.MediaSizeName - Value : 60
10: Name : class javax.print.attribute.standard.MediaSizeName - Value : 55
11: Name : class javax.print.attribute.standard.MediaSizeName - Value : 38
12: Name : class javax.print.attribute.standard.MediaSizeName - Value : 16
13: Name : class javax.print.attribute.standard.MediaSizeName - Value : 57
14: Name : class javax.print.attribute.standard.MediaTray - Value : 0
15: Name : class javax.print.attribute.standard.MediaTray - Value : 2
16: Name : class javax.print.attribute.standard.MediaTray - Value : 1
17: Name : class javax.print.attribute.standard.MediaTray - Value : 6
18: Name : class javax.print.attribute.standard.MediaTray - Value : 4
19: Name : class sun.print.Win32MediaTray - Value : 0
20: Name : class sun.print.Win32MediaTray - Value : 1
It's a printer with to trays, so I suppose the last two lines are important, but I'm not possible to effectively select the tray I want to print..

Similar Messages

  • My Macbook pro OS 10.10.2 suddenly will not communicate with my Cannon MX890 printer.  I reset all printers and now I cannot seem to add a printer by using the Add a printer function.  Ideas?

    My Macbook pro OS 10.10.2 suddenly will not communicate with my Cannon MX890 printer.  I reset all printers and now I cannot seem to add a printer by using the Add a printer function.  Ideas?

    The appearance of the printer in the Default view of the Add printer window relies on a protocol called Bonjour. There have been quite a few users who upgraded to Yosemite only to find that their wifi printer is no longer visible. Until Apple resolves this issue you can add your printer using the LPD protocol. To do so you will need to determine the IP address being used by the MX890. This can be done via the touch panel under Device Settings > Network Settings.
    Once you learn the IP address then on the Mac you can click to add the printer and select the IP icon. Here you can enter the IP address, set the Protocol to Line Printer Deamon and leave the Queue field blank. Then change the name to Canon MX890 and in the Use menu, browse for the Canon MX890 series driver. Then click Add to complete the printer creation.

  • My iPad shows a message "Cannot find AirPrint printer". I used to use my iPad to print materials using HP wireless printer D110. Now it does not want to print. Is this because I am now using IOS 7? What should I do to solve the problem? Help please.

    My iPad shows a message "Cannot find AirPrint printer". I used to use my iPad to print materials using HP wireless printer D110. Now it does not want to print. Is this because I am now using IOS 7? What should I do to solve the problem? Help please.

    Restart your WiFi router and printer by removing power for 30 seconds.

  • I need to reinstall my Canon Pixma Pro 9500 MK 2 printer on my iMac running Mavericks. It looks for software but Apple cannot find. The driver is available on my computer. Is there a way I can force the installer to use the available driver?

    I need to reinstall my Canon Pixma Pro 9500 MK 2 printer on my iMac running Mavericks. It looks for software but Apple cannot find. The driver is available on my computer. Is there a way I can force the installer to use the available driver?

    I need to reinstall my Canon Pixma Pro 9500 MK 2 printer on my iMac running Mavericks. It looks for software but Apple cannot find. The driver is available on my computer. Is there a way I can force the installer to use the available driver?

  • Installing Printers from Windows 2008 R2 printer server using the Cname

    Am having issues installing printers on workstations from the windows 2008 R2 print server using the DNS names. the servername and Full qualified Name works fine.
    l have tweaked the Registry and Disabled the StrictNameChecking but still getting an error.  this is the message am getting...
    Printer Installation Failed
    You do not have enough privilege to complete the printer installation on the local machine.
    I found this KB and did exactly what is in the KB but stilll....
    lhttp://support.microsoft.com/kb/870911/en-us
     need help

    Hi.
    I think I solved this yesterday. We got 1 printserver, with an alias, which we had this problem to connect to. I noticed that there is a difference between x86 and 64bits system entries in the registry...
    When you are having a 64bit system, you must use REG_QWORD instead of REG_DWORD, REG_DWORD is only to be used in x86 system! See below.
    Windows 2008 server R2 64-bit 
    HKLM\SYSTEM\CurrentControlSet\Control\Print
    = ”DnsOnWire” = REG_QWORD Decimal = 1
    (reg add hklm\system\currentcontrolset\control\print /v DnsOnWire /t REG_QWORD /d 1)
    HKLM\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters
    = DisableStrictNameChecking = REG_QWORD Decimal = 1
    (reg add hklm\system\currentcontrolset\services\lanmanserver\parameters /v DisableStrictNameChecking /t REG_QWORD /d 1)
    HKLM\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters\ 
    REG_SZ = OptionalNames = “aliasname” (C-name record in DNS)
    (reg add hklm\system\currentcontrolset\services\lanmanserver\parameters /v OptionalNames /t REG_SZ)
    Windows 2008 server x86 
    HKLM\SYSTEM\CurrentControlSet\Control\Print = "DnsOnWire" = REG_DWORD Decimal = 1
    (reg add hklm\system\currentcontrolset\control\print /v DnsOnWire /t REG_DWORD /d 1)
    HKLM\SYSTEM\CurrentControlSet\services\Lanmanserver\Parameters = DisableStrictNameChecking = REG_DWORD Decimal = 1
    (reg add hklm\system\currentcontrolset\services\lanmanserver\parameters /v DisableStrictNameChecking /t REG_DWORD /d 1)
    HKLM\SYSTEM\CurrentControlSet\services\LanManServer\Parameters\  REG_SZ = OptionalNames = “aliasname”
    (C-name record in DNS)
    (reg add hklm\system\currentcontrolset\services\lanmanserver\parameters /v OptionalNames /t REG_SZ)
    Don't forget to reboot your system after these changes!
    Best Regards, Mats

  • How do I get Mac OSX 10.6.4 to print to a Canon iRC2380 colour printer? Using the driver in the Mac's list doesn't work., How do I get Mac OSX 10.6.4 to print to A Canon iRC2380 colour printer? Using the driver in the Mac's list doesn't work.

    How do I get Mac OSX 10.6.4 to print to a Canon iRC2380 colour printer? Using the driver in the Mac's list doesn't work., How do I get Mac OSX 10.6.4 to print to A Canon iRC2380 colour printer? Using the driver in the Mac's list doesn't work.

    Not sure which driver you mean when you say "the driver in the Mac's list". Apple does not provide a driver for this device, so if you mean one of the default printers that are included with 10.6, like the Generic Postscript or Generic PCL, then these will only work if the optional PS or PCL print kits were installed in the machine. Given your inability to print then it would seem that you have neither kit installed. So this would require you to install the Canon UFR2 driver, which you can obtain via this link.
    With the UFR2 driver installed, you add the printer using IP > LPD. Enter the IP address of the iRC2380, leave the Queue name blank and change the Name to iRC2380. Leave the Location field blank and in the Print Using menu, browse to the "Canon iR C2380/2550 UFR II (UK)". Click OK and then Add to complete the queue creation. You should now be able to print. Please reply if it does not work.

  • My Photosmart C309g printer ALWAYS uses the photo black cartridge

    I have a photosmart Premium C309g, wireless network connected to an iMac  running OS 10.7.2. I use the printer only occasionally to print photos - I have a smaller HP printer for photos. However the C309g always uses the Photo Black cartridge for print jobs. The printer will not operate without a cartridge fitted. But Photo Black is more expensive! How do I make the printer use the ordinary black cartridge for text jobs?

    Hello,
    Thanks for the post, great question.  I've attached a link below that may assist with this, it refers to MAC OS X 10.5/10.6 but the idea remains the same.  Good Luck!
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01662356&tmp_task=useCategory&cc=us&dlc=en&lang...
    I worked for HP but my posts and replies are my own....Thank you!
    *Say thanks by clicking the *Kudos!* which is on the left*
    *Make it easier for other people to find solutions, by marking my answer with (Accept as Solution) if it solves your issue.*

  • This is regarding CBMA in SAP PI 7.3.1. I have set up the alert mail using default java mail client.I do receive the alerts via mail. But my requirement is to direct all the mails to Business workplace inbox in ECC.

    This is regarding CBMA in single stack SAP PI 7.3.1. I have set up the alert mail using default java mail client.I do receive the alerts via mail. But my requirement is to direct all the alert mails to Business workplace inbox in ECC.
    So I need to set up PI to redirect mails to ECC Business workplace user inbox (sbwp). From here rules are set up & routed per distribution list.
    Please guide me how I can achieve this requirement.

    Hi,
    yes, it is a little bit different. This is the issue.....  
    But I am not sure if your links will help:
    1) /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
    is about a different solution. I do not need to count the number of lines of the source message.
    And the second variable is about concat line by line from unbound node to unbound node.
    My issue is:
    Souce:
    Message line (0...unbound) ! ! ! ! ! ! ! !
    .    ResultLine   (1..1)
    Mapping:
    =>   ResultLine1
           ResultLine2
           ResultLine........          => into UDF to an element  (1..1) in one mapping operation.
    So that all "ResultLine"s are included.
    The result is explained in the given link for Mail attachment with UDF.
    So I am not sure how to use this thread for my issue.
    In the comments of that blog Christoph Gerber writes that the new variable feature can only handle single values.
    So it is not suitable for my purposes as I have a list of values here that needs to be moved into the target message field.
    2) http://wiki.sdn.sap.com/wiki/display/Java/UsingEditJavaSectioninMessageMapping
    shows where to find the button "Java section" which is not available here in 7.1
    3) /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
    too is about the nice little button for Java Section that is no longer existing on PI 7.1 screen for mappings.  
    So my issue is: How to replace the Java section function with global variables in PI 7.1?
    Best regards
    Dirk

  • Downloaded 11.0.3 (42) 64 bit to my MacBook Pro and it crashes every time I select a song a use the 'add to' function to add to a play list. It's never done this before, is it a bug with the new version?

    downloaded 11.0.3 (42) 64 bit to my MacBook Pro and it crashes every time I select a song a use the 'add to' function to add to a play list. It's never done this before, is it a bug with the new version?

    You could just disable updates. Change these settings in about:config.
    * app.update.auto - set to false
    * app.update.enabled - set to false
    You can still check for updates with the "Check for Updates" button in the About Firefox window, but it will download the update file anyway if there is an update available. You can also check which is the current release from here:
    * http://sjc.mozilla.com/en-US/firefox/new/

  • What controls the color of the cursor that selects text when you use the "Edit Document Text" tool?

    Hi, I have had a student ask me a question I cannot answer: what controls the color of the cursor that selects text when you use the "Edit Document Text" tool?
    I have only seen it appear as a black semicircle over each letter, but at a different computer in our training facility, this same tool appears as an aqua-green highlight.
    Is it a preference I never noticed? Thanks for any info.

    What version of Acrobat? What operating system?

  • How to select the particles after using the Particle Analysis

    Can I select the particles after the particle analysis directly, like chosing #1, #2 ..., or should I run the particle filter using the measured parameter?

    Hello Ishi,
    I now have a much better idea on what you are trying to do.  If you run the IMAQ Particle Analysis Report VI on the thresholded image that contains particles, an array of clusters will be returned that will contain specific information for each particle including the area, number of holes, bounding rectangle coordinates, center of mass, orientation, and dimensions. 
    To find out which particle is which in the image, index the Particle Reports (Pixels) output of this VI, unbundle the cluster to extract the Bounding Rectangle cluster, and then pass it to the Rectangle input of an IMAQ Overlay Rectangle VI.  This VI will overlay a bounding rectangle onto the image to show where the particle is located.  You can specify which particle you want highlighted by changing the array index of the Index Array VI that is responsible for extracting a specific cluster of particle information from the Particle Reports output of the IMAQ Particle Analysis Report VI.
    Regards,
    Mike T
    National Instruments

  • Tap to drag select by whole words using the Trackpad!

    I figured out that there is an easy way to drag select by whole words using the Trackpad... just put your mouse over the word you want to start the selection from and ...
    tap, pause, tap, tap
    ... or another way to say it might be ...
    tap, double tap
    I find this method almost 100% reliable, it's effortless to get the timing right.
    Being able to do this now removes the only thing that I've missed about a mouse since switching to the trackpad.
    Yay!

    On the trackpad, after double tapping to select a word, you cannot drag to continue selecting more words. And if you triple tap, it selects the entire paragraph. If you double tap to select a word, pause and tap-drag, the selection doesn't change with your dragging. If you double tap to select a word, pause, and double-tap-drag, it starts a drag/drop operation using the original selection.
    The method I described allows you to accomplish with a trackpad, the operation that mouse users take for granted - double click/drag to select a word and drag to select more words.
    As far as I know, the technique I posted at the top is not widely known. At least I didn't turn up anything with my google searching and have used this trackpad for almost a year without knowing about this trick.
    FYI - my trackpad "Point & Click" settings are:
    tap to click
    secondary click is tap with two fingers
    3 finger drag disabled

  • Can we run the batch file using simple java application

    Hello sir,
    we want to run the batch file using simple java application. i tried with some example, we run the exe files but not batch file.
    Runtime r = Runtime.getRuntime();
    r.exec("D:\\jboss\\bin\\run.bat");
    My application is server will run when we run the java appliation.
    any suggestion? plz give me the solutions

    yes you can run html file
    WEB.SHOW_DOCUMENT is a built-in that is used in Forms to call URL from a Web Form. It works much like the similar way that a link on an HTML page works and it takes two arguments, one is URL and second one is TARGET, in your case use following.
    WEB.SHOW_DOCUMENT('http://channas.iil.informatics.lk:8890/forms/frmservlet?config=abc.html', '_blank');
    Hope this will work for you
    Abbas

  • How do you prevent HP Deskjet IA 4615 printer from using colour to print black!!!!?​???

    I just recently bought this great All-in-One HP DeskJet IA 4615 as I've needed all the other functions besides printing for a while now. Imagine my horror when trying to specifically save on using colour when printing a newsletter to about 900 clients by putting elements of colour into a predominately black design...and then wondering why all the colours are going down so fast...then discovering that the printer is USING THE COLOURS TO PRINT BLACK!!!!
    I have looked all over for switching this off...but haven't been able to find the answer?
    Is this standard?
    In that case I'm EXTREMELY disappointed to find that HP uses this tactic to get you to use ALL the colour cartridges!!!
    Please, if anyone has the answer for me...let me know!!!!
    This is NOT a great way to find out you can't save ink no matter what you do! I hope one can...redeem my love for HP, PLEASE!

    Hey MarleMac,
    What is the Operating System of the computer you are using the Deskjet Ink Advantage 4615 with?
    If you are using a Windows PC, then open the Devices and Printers folder.   Right click on the printer and select Printing Preferences.  If you want to print a black and white document using black ink only, click the Advanced button. From the Print in Grayscale drop-down menu select Black Ink Only, then click the OK button.
    Jason
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------
    I am not an HP employee.

  • Another device on the network is using the same IP address

    While this question has been asked within the community, I cannot find an answer that solves my problem.  This happened about a year ago and was thought to be a modem/router issue.  I switched to Airport and all had been fine until a few weeks ago.  Now I periodically can't get online from my laptops.
    Settings for my macbook at System Preferences ▹ Network ▹ Advanced ▹ TCP/IP are:
    Configure IPv4:  Using DHCP
    IPv4 Address:  192.168.1.84
    Subnet Mask:  255.255.255.0
    Router:  192.168.1.254
    Configure IPv6:  Off
    We did recently get a new ipad and new wireless printer so one of them may be the issue
    Any help would be appreciated.
    Thanks!

    If you are having IP addresses assigned using DHCP and one of the devices is disconnected from the network for a long enough period of time then the router will make that IP address available to another device to use. If the first device then comes back on the network with the same IP address it had before then you'll get the dual IP address situation. This usually doesn't happen since the returning device is SUPPOSED to ask for a new IP address when it re-joins the network. In your case this may not be happening.
    What I do is use static IP addresses for all the devices on my home network. In your case I think this will fix your problem.
    Set up your Airport to 'reserve' specific IP addresses for the devices in your local network via their MAC addresses.
    Open the airport utility, select your router, click EDIT, select NETWORK.
    In the area marked DHCP Reservations: click on the + sign
    Type a description of the device.
    Use the pull-down menu to select "Reserve Address By: MAC address"
    enter the MAC address in the appropriate line.
    enter in the unique IP address for each device that you want to reserve. Make sure its in the same subnet (ie. 192.168.xx.yy)
    click SAVE
    Repeat the above for all your devices.
    Update your airport settings.
    When you're done turn off all the wireless devices for 5 minutes and then reconnect.  Each should then reconnect with the same IP address each time. You can still leave the devices themselves set to use DHCP so that when you take them outsider your network, they'll request an IP address from the new network.
    I hope this made sense. If not, post back and I'll calrify anything you need.

Maybe you are looking for

  • How do I get two different Apple IDs to cooperate?

    So, I've had my iPhone 5 for a little over a year now and just yesterday went out and bought my first Mac.  When I got my phone I didn't anticipate getting a Mac and thus used my gmail account as my Apple ID.  I was advised by a friend of mine that e

  • Photostream not updating on PC after phone upgrade

    A few months ago i upgraded from an iphone4 to an iphone 5. I just noticed that since buying this phone none of my photos taken on the new device has synced on my photostream on my PC. i have all the right settings selected on my phone...is it becaus

  • Leopard Installer.app No longer working

    Hello all, OS X will not allow me to install ANY THING , it started after installing the 10.5.3 update. I thought corrupt google Sketch up .dmg , but after trying some other .dmg installers it turns out the installer.app bounces in the dock and then

  • Unknown symbol on status bar

    a symbol that looks like a phone has shown up on my status bar. I looks like a number pad & a handset. I have never seen it before what does it mean?

  • BTE 1321 "How we configure "?

    Hi, anybody  had used BTE 1321 ,if yes the plz reply me. Regards Ricky