Print to LPD/LPR

Hi,
I'm resurecting something I gave up on 2 years ago - namely how to print using Java.
I gather that this is still a weak area, but that it can print OK to LPR printers. I've seen some example code and looked through the API docs but it isn't clear to me how I would use it! I've seen many postings here but none seem to get answers...only more people asking!
So, in a nutshell, I have some servlets which do some work and currently email their output, I'd like them to be able to print to a printer.
I'm running the servlets in tomcat on a NetWare6 server and I have LPD/LPR print services running on both a Solaris box and on other NetWare servers. The NetWare servers also support IPP.
Because the server which I'm running the java on doesn't have any local printers as such, can I hard code in a printer location rather than rely on discovery?
Hopefully someone can show me some example code doing this in return for Duke Dollars...
Thanks,
Nick.

I'd use the javax.print API. It will discover either local or networked printers.
This article might help:
http://www-106.ibm.com/developerworks/java/library/j-mer0322/
MOD

Similar Messages

  • Plain text print speed thru lpr vs. BBEdit

    When I send a plain text file to the Unix lpr command, it prints slowly; when I print with, say, BBEdit, the same text comes out much faster.
    I'm using an iBook G3 600 MHz with USB 1.0, OS X 10.4.11, and
    an Epson Stylus CX6000--a recent, non-Postscript inkjet printer with recent driver from Epson.
    Example: a one-page, 897-byte file. Counting from the time the paper starts to move:
    lpr: 120 sec (7.5 characters per second, slower than a teletype)
    enscript: 90 sec
    BBEdit: 20 sec
    (To top it off lpr uses an awful 14-point narrow font...but I already can print slowly in a better font.)
    It doesn't seem to be simply a matter of communication speed. Printing through lpr, the print head is constantly moving, but the paper advances very slowly, as if by scan lines. Printing from BBEdit, the paper advances like an inch at a time.
    My guess is that BBEdit gives the text to the printer driver which basically sends it on as text to the printer, which has a fast way to print text, while lpr goes through a postscript/bitmap process. In fact lpr is slower than enscript, which explicitly converts to postscript (which has to be rendered in the computer) before printing. (The lpr/enscript speed difference may be because lpr uses a bigger default font.)
    So: how can I access that fast text printing ability from Unix? Is there some sample Unix-style C source code out there that calls the same API that BBEdit is calling, that would be easy to adapt to printing text from a file or stdin?
    Or, an option or utility already in Mac OS X? A third-party utility that's already out there?
    --Steve
    P.S. Camino printing the edit page for this post (multiple fonts, boxes, sidebar, etc.): 28 sec. Also, inch-at-a-time.

    YES!!
    The BBEdit command line tool was apparently introduced in version 6.5, which is the version I have. In the BBEdit folder (the folder BBEdit.app is in) there is a "BBEdit Extras" folder with a "BBEdit Unix Tools Installer.dmg".
    Once installed there's a Unix command "bbedit", and you can do "man bbedit".
    Besides -p for print there's -b for background, so you never even see anything happen on the screen.
    It prints with the defaults set in BBEdit's preferences. I like Courier 10.
    I do appreciate enscript. That's what I meant when I said I already knew how to print nice fonts slowly. Also, 2-up is nice, I have my own script for it!
    Thanks a lot, etresoft!
    --Steve

  • Bursting : printing using LPD protocol?

    Hi everyone,
    I am having trouble sending my .pdf output to a printer and wondered if anyone has used LPD protocol instead of IPP. I am on 5.6.3 and read that it may be supported on this version. If anyone is using this, an example from your control file would be great!
    Thanks
    -CC

    So... Is everyone out there using the ipp command that is in the user guide? I am not sure that we have CUPS set up. Do you need that to be able to print? Is there any other way to print from the bursting control file if you don't have CUPS set up?
    Any help on this would be greatly appreciated!!
    -CC

  • Trouble with printing through 10.8 shared printer using lpd.

    Hi, hoping someone will have had a similar issue.
    I am using a OSX 10.8 mac mini as a print server.  I am using it as a print server because because i have clients that print across subnets and bonjour will not work for this application.  Previously with my 10.7 imac I had shared the generic printer aimed directly at the printers IP address.  Client macs aim at the print server using lpd (using ip or host name) and then the printer name (share) for the queue and also use the generic ppd. When a client adds this configuration aimed at the old 10.7 print server the printer would install and printing would be succesfull.  Now with the 10.8 print server a client (reguardless of client OS version) i get the "Unable to verify the printer on your network." when installing and printing fails. I have tried the proper ppd for the make/manufacture of the printer (i didnt think this would make a difference) I have tried using the cups commands as well:
    cupsctl --share-printers
    cupsctl --share-printers --remote-any
    cupsctl 'BrowseLocalProtocols="cups dnssd lpd smb"'
    assuming lpd was just not available and needed to be turned on...
    I am able to ping the 10.8 on the network from clients verifying they can see the server
    also have tried using ipp with no luck.
    Anyone else had this issue and if so is there a work around?  Thanks!

    The Mini prints just fine to the printer.  on a side note, I tried to add a "client" printer to the mini server.  I added a printer using the ip address 127.0.0.1 (self resolving)  and the que name as the share.  This didnt work either.  Im thinking this must be a cups setting?

  • Connecting to USB connected printer via LPD

    Hi there,
    Does anyone know if you can access a USB attached printer using the LPD protocol? I cannot find this in the Time Capsule documentation.
    I'm helping a Yosemite user where Bonjour is not working and thus the USB connected printer is not being advertised in order to add it.
                     How to get Yosemite to see new printer driver for Canon via Bonjour            
    For other brands, the USB port has a name like Port1 or PR1. So I would like to know if the Time Capsule supports such a connection.
    Thanks
    PaHu

    Hello PAHU. I'm thrilled to have run across you on the Apple site. Your post (below) is exactly what I need help with:
    "Rather than use Bonjour, which seems to have a problem for some users who have updated to Yosemite, you can use one of the IP protocols included with OS X. To do so you will need to find the IP address the printer is using. If you need help with that, reply with the model of Canon you have.
    With the IP address noted, open Printers & Scanners and click the plus button to add. Select the IP icon and enter the Canon IP address in the Address field. Change the Protocol to LPD and leave the Queue blank. Change the Name to the model of Canon and then in the Use menu, select the appropriate Canon driver for your model. Click the Add button to complete the printer creation and then see if you can print."
    Kindly please tell me how to find my printer's IP address. I am desperately trying to reconnect to my Canon PIXMA MP500 since upgrading to Yosemite. I will be in your debt!
    Thank you most kindly!

  • A script for sharing LPD printer preferences

    Hello,
    I just setup a LaserWriter 8500 for TCP/IP printing using LPD/LPR and a specific IP address in Mac OS 10.4.
    Now, however, I have to add this printer to a plethora of computers, and I was wondering how one would create either a script or a .PPD that would replace my current manual installation (which requires changing the model type, manual name change, printer optional settings, etc.) on each office computer.
    I know I am asking a lot, but a 'one-click' solution would just rock my world...for at least a day.
    Thanks in advance.
    —SRB

    copy two things:
    /etc/cups/printers.conf [=the printer list]
    /etc/cups/ppd/ [a folder of the PPDs that match the list]

  • OS X 10.4.6 and Linksys PPSX1 printing issue

    I recently upgraded to Tiger from Panther with a couple of regrets, one of which is related to using a Linksys PPSX1 Etherfast Print Server. Under Panther I had successfully created a printer using LPD/LPR, naming a que and selecting my printer (an NEC SuperScript 1800 with a PostScript upgrade). The SuperScript has only a parallel interface (which is why I bought the parallel printer version of the Linksys Print Server).
    I also have a Windows PC and I share an internet connection with the G5 using a Linksys Cable/DSL router (hard-wired, not wireless). The Windows machine can print to the SuperScript via the Print Server (which occupies a port on the Cable/DSL router) without a hitch. My G5 did too, under OS X 10.3 Panther. But Tiger refuses to allow me to set up a printer using LPR. It allows only the LPD option.
    For their part Linksys is no help. They don't promise any functionality using a Mac. And ditching the SuperScript is out of the question. Even though it's 8 years old it's a magnificent printer: 1800 dpi and very fast.
    Help, please.

    It's a lot easier than going to the Advanced menus...
    When you click ADD, the first window that comes up is ususally the default browser box. At the top of that window there are two icons - the right one being IP printer. Click on IP printer and then you are given a pull-down with three TCP/IP protocol choices. Choose LPD from there.
    Now for the harder part. On windows they have setup software - on OS X we have to handle details ourselves. The most common problem is not entering the print server's queue name for the IPP and LPD protocols. You can find the queue name in the print server manual. L1 lp, lpt1, etc are common queue names.

  • [Embarassingly Solved By Myself] Installing HP Printer

    I haven't had trouble with connecting a printer in awhile (mostly because I havent used my printer in about 9 months) but Ive been trying to get it to work for the past few days and cups acts like everything works correctly but a page never gets printed. Thinking that the problem may have been my tweaked rc.conf i replaced it with the original one and rebooted, in the print manager it showed that a job was queued (since I had just sent one before) and it wouldnt let me do anything with it.
    I decided to remove the printer config and reinstall it. Using KDE system settings to install it is slightly confusing (compared to the one in 3.5 atleast) since it only offers the options of new network printer and new printer class under the New Printer group and my printer is connected via usb. I found out before that clicking on the new network printer allowed me to install a local printer but now I cant remember how I did it. Under new network printer I have the following groups: CUPS-PDF,AppSocket/HP JetDirect, Internet Printing Protocol,LPD/LPR Host or Printer, Windows Printer via SAMBA, and other. I have no idea which one to use.
    I looked up cups in the wiki and it suggests that you use the web interface to config cups so I tried that also and under adding printers or classes I selected add printer and selected HP Printer (HPLIP) under local printer then hit continue. In the connection field it says "hp" and if I hit continue it doesnt do anything. Im assuming it wants the address of the printer (I remember seeing it before as usb://[address]) but I have no idea what it is.
    Last edited by brando56894 (2009-10-26 21:41:31)

    mine doesnt even show up in dmesg when I turn it on, nor is it in /dev/usb. I probably should have mentioned this before but its an HP All In One Deskjet 1610.
    heres my complete lsmod
    Module Size Used by
    ipv6 338528 22
    it87 28056 0
    hwmon_vid 3872 1 it87
    vhba 10816 1
    loop 19948 0
    fuse 74944 6
    nvidia 10324072 0
    snd_seq_dummy 3588 0
    snd_seq_oss 36320 0
    snd_seq_midi_event 8640 1 snd_seq_oss
    snd_seq 64768 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
    snd_seq_device 8372 3 snd_seq_dummy,snd_seq_oss,snd_seq
    hid_logitech 11744 0
    ff_memless 6632 1 hid_logitech
    nouveau 668412 0
    ttm 50912 1 nouveau
    drm_kms_helper 30176 1 nouveau
    drm 198272 3 nouveau,ttm,drm_kms_helper
    i2c_algo_bit 6980 1 nouveau
    fan 5704 0
    wmi 8000 0
    battery 13896 0
    joydev 13376 0
    thermal 17760 0
    ac 5640 0
    processor 42364 0
    button 7264 0
    usbhid 47968 1 hid_logitech
    hid 52608 2 hid_logitech,usbhid
    snd_hda_codec_realtek 286788 1
    ide_cd_mod 33224 0
    sr_mod 19556 0
    cdrom 41320 2 ide_cd_mod,sr_mod
    amd64_edac_mod 23240 0
    edac_core 51660 1 amd64_edac_mod
    snd_hda_intel 32232 4
    k8temp 5760 0
    snd_hda_codec 83168 2 snd_hda_codec_realtek,snd_hda_intel
    sg 33664 0
    snd_pcm 91784 3 snd_hda_intel,snd_hda_codec
    snd_timer 25424 3 snd_seq,snd_pcm
    snd_page_alloc 10832 2 snd_hda_intel,snd_pcm
    pcspkr 3296 0
    serio_raw 7268 0
    evdev 13024 12
    r8169 41348 0
    mii 5856 1 r8169
    snd_hwdep 10056 1 snd_hda_codec
    snd_mixer_oss 21024 0
    snd 77224 16 snd_seq_oss,snd_seq,snd_seq_device,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer,snd_hwdep,snd_mixer_oss
    soundcore 8768 1 snd
    slhc 6624 0
    forcedeth 64012 0
    rtc_cmos 13756 0
    rtc_core 22116 1 rtc_cmos
    rtc_lib 3168 1 rtc_core
    ext4 361960 1
    mbcache 9028 1 ext4
    jbd2 97344 1 ext4
    crc16 2144 1 ext4
    ohci_hcd 27132 0
    ehci_hcd 41808 0
    usbcore 183764 4 usbhid,ohci_hcd,ehci_hcd
    ahci 44080 4
    i2c_piix4 11536 0
    i2c_core 25664 5 nvidia,nouveau,drm,i2c_algo_bit,i2c_piix4
    pata_atiixp 6368 0
    atiixp 4644 0
    ide_core 120576 2 ide_cd_mod,atiixp
    pata_acpi 5824 0
    ata_generic 6244 0
    libata 193612 4 ahci,pata_atiixp,pata_acpi,ata_generic
    sd_mod 31848 7
    scsi_mod 133528 5 vhba,sr_mod,sg,libata,sd_mod
    Edit: I booted into another install of Chakra that I have that I was using for testing stuff and its pretty clean compared to my other install. I noticed these errors appeared in both of the dmesg logs:
    Buffer I/O error on device sr1, logical block 178507
    sr 5:0:0:0: [sr1] Unhandled sense code
    sr 5:0:0:0: [sr1] Result: hostbyte=0x00 driverbyte=0x08
    sr 5:0:0:0: [sr1] Sense Key : 0x3 [current]
    sr 5:0:0:0: [sr1] ASC=0x11 ASCQ=0x5
    end_request: I/O error, dev sr1, sector 1428056
    Buffer I/O error on device sr1, logical block 178507
    Could this be the printer?
    This install of chakra has cups 1.3.11 installed and it cant find the printer either nor can kde systemsettings.
    Edit 2: I was going to try and test it out in windows 7 to see if it works but I cant install the drivers since they are for the offical release version (build 7600) and Im still running RC1 (build 7100)
    Last edited by brando56894 (2009-10-24 18:16:32)

  • IPP printing delay

    Why is it that when I add a printer via ipp, then I try to print it takes anywhere from *1 to 2 minutes for the job to reach the printer*? This is true wether I do this on leopard client or server, and sharing the queue on the server. When I setup a printer via lpd/lpr it prints instantaneously. What is it about ipp? In Tiger server/client I did not experience this problem. I am running Leopard server on a G5 dual 2 GHz with 2 gig RAM. I added the printer on the server via ipp and sharing via ipp. I print from tiger clients. Also when I print from the server itself I get these results. Any thoughts?

    Elliott,
    How are you connecting the printer to the XServe / Mac OS X server machine? I'm trying to resolve a printer performance issue when printing via IP, and thinking it may be possible to connect it to the XServe via USB and setup the print services on Mac 10.4 server to get around the performance problem. If IP is fine, per your comment, then I'll save a bit of time monkey-ing around with the physical setup i.e., server and printer aren't within 16 feet of each other.
    Derek

  • No network printer

    Hi everybody,
    I have a G4 Sawtooth 450MHz machine running 9.2.2 connected to a Netgear ADSL Modem/Router DG834g through Ethernet cable.
    It has happily been connected and surfing the net no problems, as soon as I turned on the router it done most of the insulation it's self. The modem is also connected to a PC hard wired through a Ethernet cable the only wireless connection is a Windows Laptop.
    I have now added a USB mini print server, both PC and Laptop will print to the printer (Laptop wirelessly) the G4 does not see it but still see's the router ok.
    The printer used to be connected through a hub which worked fine (wired) but for the Laptop to print the PC had to be turned on, this is why I was hoping to connect through the print server.
    Any ideas on how to get the G4 to see the now networked printer??
    Thanks
    Paul

    Paul, welcome, I have a very similar setup here, only difference is I am running 10.3.9. The G4 is set up for IP printing with LPD/LPR, a printer address set to one of the router ports and a Queue Name listed as the Port Name in the Print Server manual. However, it does not print from OS9 or Classic and I was told that it was not possible. So I guess my question is does it say that the Print Server is OS9 compatible.
    Joe
    Power Mac G4 Gigabit Ethernet   Mac OS X (10.3.9)  

  • Share an edited photo with PS Express?

    I recently took a photo that had one element that needed a targeted color adjustment. I have Photoshop Mix, PS Express and Lightroom Mobile on my iPad so I thought great, I can select/isolate the object in Mix ( color adjustments there are limited to presets and none of them fit my needs), and then open the selection in Lightroom or Express and do the adjustments. The only format I could find to save the image in Mix that would preserve transparancy was the "save to photohop" option which saved a PSD to Creative Cloud. The only problem here is that I can find no way to then import this PSD from Creative Cloud to Express (I realized at this point Lightroom Mobile, with it's limited file support, was out). I also tried Revel and that doesn't work either ( that I could figure out). So really, am I to believe that with the 3 different ways of sharing files, Lightroom Mobile, Revel, and Creative Cloud, there is no way to move files from one Adobe Photoshop type app to another on an iPad?!?!? Please tell me I wrong.

    eteen wrote:
    I resolbed the acces to the admin page. On X.6.2 and less, Icould acce the CUPS interface with my IP address recived from my router ex: 192.168.0.100.
    On x.6.3 I need to use localhost to acces the admin page.
    I've always used localhost (127.0.0.1) to access the CUPS page. Using the assigned IP has always been an issue Tiger, Leopard and now Snow.
    The terminal did accept the command but no printing using lpd lpr.
    I finally used IPP pri ting with succes.
    Lpd was the only way I could use my inkjet printer on OS 9 and less.
    If anyone has a way to reenable it on X.6.3 that would be welcome.
    Good to read that you got it working with IPP.
    I'm not sure that anything additional needs to be re-enabled for LPD/LPR to work. For a standard install of 10.6.3, after adding LPD to the "Browse Local Protocols" command via Terminal, I was able to print to my shared Canon MP980 inkjet from XP SP3.
    Maybe someone else can offer some insight...

  • Konica c351 with fiery not working in Leopard

    Hi,
    We have a konica c351 with a fiery controller. Konica says they will not update leopard drivers for this machine. Any ideas?

    If there is Universal Binary versions of the Fiery driver available, you can use them on Leopard, even if they don't say they are supported. However, if there is only a PPC driver available, then you may have problems with the plugins not working correctly. But, if you don't make use of the services provided by these plugins, then you copy the ppd for the RIP into Leopard and use it.
    Most of the EFI (Fiery) installers have the ppd available separately and typically located in the language folder, such as English. If you find the ppd, copy it to /Library/Printers/PPDs/Contents/Resources/en.lproj. (Note that if you need to copy the ppd from a Tiger installation the path above is where you would find the relevant ppd).
    Once you have the ppd copied into this folder you can then create a IP printer using LPD/LPR, input the IP address and queue name (important for Fiery controllers) and then open the Print using menu, select Other and search the list for the RIP. Click Add once found to complete the installation.

  • Share an Epson C86 with a PC using CUPS on Snow Leopard 10.6.3

    Hi,
    I used to do this a lot in previous version of OS X but I am stuck with X.6.3.
    I would create a printer in OS X. Share it in the pref panel. Then would co in CUPS and find the queue name.
    Then I would go on a PC. Add a PS printer (Apple laserwriter or similar) create a TCP port and point it to the mac IP and queue name found in CUPS.
    Would always work like a charm. Even on Mac OS 7.5 and up....
    Can't get to print. Windows can't print to the shared printer in X.6.3. I do not want to use Bonjour for this. LPR used to work.
    Questions :
    Does CUPS 1.4.3 still support LPd/LPR on OS X. The documentation of CUPS says so...but does SL let it in?
    If not, how to enable it?
    Now I get a forbidden message when I try to access the admin section of CUPS sine I upgraded to X.6.3.
    Any help would be appreciated....because this is a no go to upgrade to SL...
    Thanks!

    eteen wrote:
    I resolbed the acces to the admin page. On X.6.2 and less, Icould acce the CUPS interface with my IP address recived from my router ex: 192.168.0.100.
    On x.6.3 I need to use localhost to acces the admin page.
    I've always used localhost (127.0.0.1) to access the CUPS page. Using the assigned IP has always been an issue Tiger, Leopard and now Snow.
    The terminal did accept the command but no printing using lpd lpr.
    I finally used IPP pri ting with succes.
    Lpd was the only way I could use my inkjet printer on OS 9 and less.
    If anyone has a way to reenable it on X.6.3 that would be welcome.
    Good to read that you got it working with IPP.
    I'm not sure that anything additional needs to be re-enabled for LPD/LPR to work. For a standard install of 10.6.3, after adding LPD to the "Browse Local Protocols" command via Terminal, I was able to print to my shared Canon MP980 inkjet from XP SP3.
    Maybe someone else can offer some insight...

  • How to print from ipad/iphone (printer=LPD)

    Hi!
    The printer is connected to the network. LPD/LPR.
    I have done the setup in my mac book and it is okay to print!
    But i would like to print from iphone/ipad sometimes.
    The problem: is it possible? if yes, how to do it? It seems quite different since i can't add a printer in iphone as it is in Mac
    Could so

    Yes you can. All you have to do is to open the file then click the share button and choose print. However you have to make sure that the printer is connected to the same wifi as the ones in you phone/ipad. Plus, you can't save the printer to the phone, so you'll have to choose then and there. Furthermore, sometimes the IP address would just get messed up and thus, different IPs from the devices, would not print.

  • Lpd printer error "Unsupported colorspace = -1."

    I cannot get my printer work on Mac, it works from windows.  It's on the network setup as lpd connection.  I get an error "Unsupported colorspace = -1."  Any ideas?
    Printer Epson Stylus Photo RX600
    Right now it's connected to my wireless router (it has USB ports and acts as a print server)
    I also tried accessing it as a windows shared printer when it was directly connected to another windows computer but same error occured.
    Yes I just got this Mac and I'm Mac stupid.
    Thanks

    OK I got it to work.
    All instructions online from printer manufacturer, print server, etc are wrong.
    What I had to do:
    System Preferences > Print & Scan
    Add a printer
    Right click to add the Advanced icon to the toolbar
    Advanced
    Type = LPD/LPR Host or Printer
    Leave device as another device
    Enter lpd://ipaddress of print server/lpdservername
    Enter name and location of printer
    Here's the key, let it auto select the printer, if I select the epson printer it doesn't work, it autoselects Generic PostScript Printer and all works.
    Hope this helps if anyone is having the same issue.

Maybe you are looking for

  • Help with making your own theme... (question)

    I have a Imovie HD 6.0.3, I wanted to make my own theme. The other themes are great, but i want to create my own, so I could show to make friends. I cant find anything related with making a new theme. PLEASE, PLEASE, PLEASE help me...

  • Half of my IPhone 5 is broken.

    I dropped my Iphone 5 and the left hand of the screen isn't responding to touch and its dark, the glass is cracked but I was wondering what exactly is wrong with it like what parts may be messed up.

  • Daisy-chaining Metric Halo ULN-2 with G-Drive HDD...

    Hi all I have a Metric Halo ULN-2 which I use via Firewire on my iMac. The iMac is iMac 1.83GHz Intel Core Duo with 2Gb RAM (sadly, I don't think I can upgrade the RAM) and has only one Firewire Buss, so I am assuming, should I wish to use the G-Tech

  • How do I get my existing photo library from iPhoto to Photoshop?

    How do I get my existing photo library from iPhoto to Photoshop?

  • Cannot receive mail- suddenly stops

    I have a MacBook Pro running 10.5.8. Since yesterday I have been unable to receive email. MAil activity progress bar shows that it has started but the KB/S slows to 0 and nothing is ever received. I receive the emails on my iPhone so not sure why not