Printing Documents through the Default Printer

I have come across a problem, where it is getting difficult for me to enable my swings application to print a paper through the default printer which is installed. What should i do in this regard?

Actually you just have to write
      // Create a job
      PrinterJob job = PrinterJob.getPrinterJob();  
      // Transmit the printable objet to the job
      job.setPrintable(yourPrintableObject);
      // Print the job
      try {
         job.print();
      catch(PrinterException e) {
         System.out.println("PRINTING ERROR: "+e.getMessage());  
      }Of course, you need a default printer set on the system...
Hope this helped,
Regards.

Similar Messages

  • Why have I lost PDF printing capability through the File Print menu?  When will it be fixed?

    Why have I lost PDF printing capability through the File>Print menu?  When will it be fixed?

    What app are you using to view PDF files? Preview can be a poor choice for some PDF files - I recommend using Adobe Reader - http://get.adobe.com/reader/ - perhaps it will solve your printing problem.
    Clinton

  • How can I retrieve the IP address of the default printer from the windows registry

    I am using LabVIEW 7 on windows NT4 computers.
    I have a SubVI that I use to ping the network printer to make sure that the printer is on line prior to sending a print at the end of testing a unit.
    If LabVIEW does not get a reply to its ping data is saved locally and the user informed.
    I would like to modify the VI that pings the printer to ping the default printer of the computer on which the VI is running.
    I would be grateful if anyone can show me how to retrieve the default printers IP address.

    Hi Stuart,
    The registry entries for User's Default Printer are:
    Win 9x:
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\Curr​entVersion\Windows]
    NT/XP:
    [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows]
    "Device"="Printer Name"
    The device is the name used to represent the printer in the registry. The name can be found in the [HKEY_CURRENT_USER\Printers\Settings] key.
    Machine name is part of the "Printer Name," which you can use to ping directly (i.e., w/out having to look-up its IP address).
    Hope this helps.
    Regards,
    Khalid

  • When changing the default printer in windows vista why doesn't the default printer change in firefox (firefox was running when the default printer was changed)?

    I am not sure whether or not this is a bug or a feature, but I was running firefox on my laptop. I then went to add a new printer and set it as a default printer. When I went back to firefox to print, it did not automatically choose that new default printer as the printer of choice. I then had to choose the new printer manually to print to. This is merely a convenience issue but thought I would bring it to the attention of Mozilla in case.

    Hello bradleesargent
    as i can see the note in the kb article ([https://support.mozilla.org/en-US/kb/how-print-websites#w_print-window-settings Print window settings]) ''The default printer is the Windows one. When a web page is printed with the selected printer, it becomes the new default printer.''
    do you have your previous printer also, or you uninstall the previous printer and then install the new one and make it default ?
    I think firefox must be closed when you set up a new printer. Do you have it open when set up the new printer ?
    thank you

  • How can I set the default print settings of my document as color.  I want the default print setting to be color when someone opens a document.  similar to duplex print preset is there a color print preset?

    How can I set the default print settings of my document as color.  I want the default print setting to be color when someone opens a document.  similar to duplex print preset is there a color print preset?

    Hi,
    Try saving your settings as a Preset by clicking the Preset drop down and then select Save Current Settings as a Preset.
    Next try changing the settings by selecting the saved preset.
    That allow saving the settings for a specific printer, I assume it may also allow selecting these settings for another printer.

  • Is there a way to change the default print tray on an HP LaserJet 500 color M551 Printer

    Hi
    Is there a way to setup the default print tray for a HP LaserJet 500 color M551 printer to be tray 2 printing both online and direct?
    If so what would be the best way to go about implementing it?
    Thanks
    This question was solved.
    View Solution.

    Usually, you can change the default paper trays through the control panel and through the Embedded Web server (EWS).
    Check the settings on your control panel. Here is a link to the User Guide, check out page 94 and see if that helps you out.
    m551 User Guide
    For the EWS, put the printer IP address into your browser, then go to the tab that would list tray settings. Not sure exactly which tab has it for this printer series, but on other printer series it is on the system tab under paper setup.
    I am an HP employee.
    Say Thanks by clicking the Kudos Star in the post that helped you.
    Please mark the post that solves your problem as Accepted Solution

  • Can't tie emailed Pages document to my default printer

    In our office we have several printers: HP LaserJet 1300, HP Color LaserJet 2605dn, HP LaserJet 4/4M PS, etc.
    On my MacBook Pro I have set HP LaserJet P2055dn as my default printer.
    My colleague from office sent me Pages document via email. On his MacBook Pro default printer is HP Color LaserJet 2605dn, and I also have this printer set up as a network printer, while my default printer at home is HP LaserJet P2055dn.
    Every time I have to print his Pages '09 document, the default printer is HP Color LaserJet 2605dn. Even if I specify my own printer in Page Setup dialogue window, save it as the default printer — after closing this document and reopening it the same old HP Color LaserJet 2605dn is back as the default printer for this document again. Every time I want to print this document I have to change printer back to my HP LaserJet P2055dn.
    Two questions:
    1) Why can't Pages use my default printer as the default printer?
    2) Why Pages doesn't save default printer for this document which I specify in Page Setup dialogue?

    As fruhulda said, this problem has been discussed at great length, but no solution seems to have been found. I have a Canon and an Epson, but am not currently using the Canon, yet every document I first printed with the Canon still shows it as the selected printer. I have to change to the Epson each time I print one of those documents. I finally decided it was unproductive to get frustrated all the time and to take a positive attitude about it: it teaches me look and think about what I’m doing rather than blindly clicking buttons. It didn’t fix the problem, but it brought a bit of serenity into my life. Philosophy vs technology.
    Walt

  • How to have "black and white only" be the default print option

    Just installed a new printer and would like to set it up so that the default print option is black and white only. How do I do this?

    Can't find this anywhere. I'm brand new to Macs so I
    might need more detailed instructions.
    I have an HP Photosmart C6100 by the way.
    Not sure which post you are responding to since you replied to yourself
    Every printer is a little different so you may have to do some searching through the settings. I don't have an HP Photosmart C6100 here so I can't say for sure where the setting is for that printer.
    The closest thing I have to that model printer here is an HP OfficeJet 6310
    In that model you choose Paper Type/Quality
    In drop down menu under Color you select Gray Scale
    Then you can still save the preset as I described in my previous post.
    If the C6100 is different than that you may just have to search through option pages and explore the drop down selections.
    Which I could be more specific, but they are all a little different.

  • Pages does not select the default printer.

    I have an IMac, 2.8 GHz, running version 10.6.5 connected to a Canon MX860. Under Print & Fax preferences, I list two printers. The first is Canon MX860 USB and the second is Canon MX860 Wireless. The default is set for the wireless. On all applications except "Pages", the default printer is the one selected. But, PAGES always selects the USB one. Is this a bug in PAGES, or is there something I can do?

    Yvan, not wishing to incur your ire... I have a similar problem and went through pages of discussions generated by the search function. I cannot find a thread matched with exactly with what I believe to be the issue here. My default print setting is wireless and all apps respect that including Pages (Version 09) generic templates. However, when I print from a Pages template that I created, it always defaults to the USB connection of my printer - and I do not leave the USB cable plugged in. I have tried to modify the template by opening it, File, Page Setup, Attributes, Format for wireless printer - save template.... Yet it still defaults to the unconnected USB version of my printer. Even doing page set up and then trying to print immediately, it defaults to the USB version. My printer is HP Photosmart C4585.
    Yvan if you know of the right thread, apologies but could you point me to it please?
    Many thanks for your patience

  • The printer that comes up when i hit print is not my default printer

    I can print from my documents or desktop but when I open firefox and try to print it opens a print window with a fax as my printer. I can hit the down arrow and see my printer but it will not allow me to select it. My default is the correct printer

    I would suggest to the Firefox team that the next build should recognize the system's default printer. Scrap this "last used" nonsense.
    I used an HP 832C until it quit functioning properly, and bought a new Brother laser printer. I did not remove the 832C from my system, for I thought I might be able to get it repaired and back on line. It is a color printer, I have lots of ink for it, the Brother is black-and-white.
    As with the OP, I was printing successfully from everywhere else outside of Firefox, the Brother was doing its job.
    I bought something online, and had the option to "Print this page" and have a printed copy of my transaction. Nothing.
    Windows 7 Control Panel's Devices and Printers, and there were no jobs awaiting printing in the Brother. So I looked at the disconnected HP 832C. There sat two jobs in the print queue.
    There was no option to visit the File menu from the "Print this page pop-up to where I could go down and select my printer. Fortunately, Walmart sent me an email that I could print after selecting the proper printer.
    I am supposed to believe that after I have set the system default printer, all my '''good''' software is going to honor that choice.
    My solution was to uninstall the HP printer, which I did not want to do. Perhaps had I known that Firefox was now going to respect my Brother, having used it once, removal of the HP was unnecessary.
    So once again. I say scrap this “last used” nonsense and use whatever the system has been set to (unless there is an option to override the default that I can opt in to).
    My two cents' worth.

  • Outlook 2010 only pick up the default printer, ignore the manually selected printer.

    when I want to print paper through word or excel, I select printer-A, I got the paper from printer-A, which is fine. but in Outlook 2010, I did the same selection of Printer-A, and the outlook show the printer-A had been selected, but the paper was came
    out from printer-B, which is default printer in the windows 7...
    is anyone having this problem?

    Hi,
    I've seen some add-ins caused this issue, please start Outlook in Safe Mode to print:
    Press Win + R, type "outlook.exe /safe" in the blank box, press Enter.
    If then there's no problem selecting the printer to print, disable the suspicious add-ins to verify which caused the problem.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Replacing the default Print Manager

    I'm currently working on a project and was wondering if its possible to create a Print Manager in Java to replace the Default Print Manager.
    In other words, i want the applications to send the print jobs to "My Print Manager" instead of the default print manager.
    Hope someone can help me on this. Any info relating to this is helpful.
    Thanks
    James

    These may offer some help:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02762273&cc=us&dlc=en&lang=en&lc=en&product=519...
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03275041&cc=us&dlc=en&lang=en&lc=en&product=519...
    007OHMSS
    I was a support engineer for HP.
    If the advice resolved the situation, please mark it as a solution. Thank you.

  • The default print setting on my officejet 4620 is the fax.

    The default print setting on my officejet 4620 is the fax. I can find no option to select the print option as the default in the control panel or any other menu.  Thanks.

    These may offer some help:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02762273&cc=us&dlc=en&lang=en&lc=en&product=519...
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03275041&cc=us&dlc=en&lang=en&lc=en&product=519...
    007OHMSS
    I was a support engineer for HP.
    If the advice resolved the situation, please mark it as a solution. Thank you.

  • Problems Converting word documents with the Adobe Printer and method ,printout (OutputFileName:=) in

    I would like to write a vb-procedure to convert a word document into pdf.
    I'm developing in "Visual Basic 2005 express edition" and tried the following code:
    code[
    Private Sub PrintDocument(sDocName As String,sNewDocName As String)
    'sDocname = "c:\tmp\test.doc"
    'sNewDocName = "c:\test\test.pdf)
    Dim m_wdApp As Word.Application = New Word.Application
    Dim m_wdDatei As Word.Document
    m_wdDatei = m_wdApp.Documents.Open(FileName:=sDocName)
    m_wdDatei.PrintOut(Background:=False,OutputFileName:=sNewDocName, _ ActivePrinterMacGX:="Adobe PDF")
    m_wdDatei.Close(False)
    m_wdDatei = Nothing
    m_wdApp.Quit()
    m_wdApp = Nothing
    End Sub
    ]End of code
    After running the printout line I can see a little window popping up, which shows the progress in the converting and after a little time I can find the expected file in the targetdirectory.
    The problem is that I can't open this file, I just get the message that the file is corrupt or not of the pdf-format.
    By scanning the web, I found several threads describing the same problem, but so far I found no solution. Maybe someone here can help me.
    Adobe standard 7.0.5.2005092300
    COM: Microsoft Word 11.0 Object Library

    You were right.
    I've changed the default printer to "adobe printer" and created a new file. I thought the problem solved, but instead, the error is the same. The new file starts like this:
    %!PS-Adobe-3.0
    %%Title: Microsoft Word - P0017083.OPB
    %%Creator: PScript5.dll Version 5.2
    %%CreationDate: 3/31/2008 19:42:4
    %%For: MMasshoff
    %%BoundingBox: (atend)
    %%Pages: (atend)
    %%Orientation: Portrait
    %%PageOrder: Special
    %%DocumentNeededResources: (atend)
    %%DocumentSuppliedResources: (atend)
    %%DocumentData: Clean7Bit
    %%TargetDevice: (Adobe PDF) (3016.102) 0
    %%LanguageLevel: 3
    %%EndComments
    %%BeginDefaults
    %%PageBoundingBox: 0 0 595 842
    %%ViewingOrientation: 1 0 0 1
    %%EndDefaults
    %%BeginProlog

  • How to send a file top the default printer?

    Hello,
    I have generated, using Java code, a certain HTML file and wrote it to a certain location on my local machine. I would like now to automatically send this file for the default printer for printing, this way the user won't have to manually open the file and select
    file->print from the browser window and then print it.
    How can I acomplish this?

    hi
    good
    how can you identify which file you r going to print and which file you r going to print.if you r going to print all the file from that particular location than you can do it through jsp, but i dont think it can be done automatically, the user has to select the particular location where you have stored the file in you hard disk and i will go for printing.
    Thanks
    mrutyun

Maybe you are looking for

  • Sending email leaves duplicates in the Draft Folder

    When I am sending particularly large email messages, the email gets sent, but for some reason a duplicate of the message gets left in the Drafts Folder. So now I have the same email that I had just sent in the Drafts Folder and in the Sent Folder. So

  • Help on BPM Steps (Lookups are not allowed, so only BPM)

    Hi Experts, Please help me to design the BPM for the following process (A mandatory rule is Lookups are not allowed so I must finish this with out using lookups.) Step1. We get a file from FTP, Once we get  the file, We need to get the next unique id

  • Workgroup Manager doesn't show groups in drawer

    OSX Server 10.6.8 on an Xserve. Trying to migrate (manually) a 10.5 setup to a 10.6 system. I exported WM users, then imported them. On the surface all looks well. On the 10.6 system, viewing the list of users, I select a user, then the Groups tab. I

  • Deleted messages are gone after 2 weeks!

    After I delete my message, it goes to the trash. I have changed the preference to go to the new folder and not automatically delete the messages after 30 days, but they are not working. My messages are gone after 2 weeks and not in any folder. Please

  • %SIP-3-BADPAIR:

    Please can anyone explain this error message and what caused it. I see whenever I made an inbound call: pr 15 11:31:09.565: %SIP-3-BADPAIR: Unexpected event 16 (SIPSPI_EV_CC_CALL_MED IA_CHANGED) in state 11 (STATE_RECD_INVITE) substate 0 (SUBSTATE_NO