I need to print with a number of copies set

Hi im trying to print with number of copies set but it dosent work.. I tried it on 3 different printers.
It only print 1 copie when i say 2 or 3 or 4...
(aset.add(new Copies(2)); )
Is there something missing in that code...
thanks
Here is my code.
import java.io.*;
import javax.print.*;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Copies;
    public class Print {
        public static void main(String[] args) {
            try {
                // Open the image file
                InputStream inputStream = new BufferedInputStream(new FileInputStream("c:\\coupon.txt"));
                // Find the default service
                DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                PrintService service = PrintServiceLookup.lookupDefaultPrintService();
                PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
                aset.add(new Copies(2)); // Dosent work only 1 copie is printed
                // Create the print job
                DocPrintJob job = service.createPrintJob();
                Doc doc = new SimpleDoc(inputStream, flavor, null);
                PrintJobWatcher pjDone = new PrintJobWatcher(job);
                // Print it
                job.print(doc, aset);
                // Wait for the print job to be done
                pjDone.waitForDone();
                // It is now safe to close the input stream
                inputStream.close();
            } catch (PrintException e) {
                System.out.println(e);
            } catch (IOException e) {
                System.out.println(e);
    }

Same problem here. I have found hundreds of questions in several places, but no answer.
Problem is that when I set the copies, PrintServiceLookup.lookupPrintServices returns no results.
Please help.

Similar Messages

  • Need to print with out comma

    Hi all,
    My table is loaded like this 123,678 .00 .I need to extract the data without comma like this 1234678.00
    can any one help me to resolve this issue?
    Thanks in advance.

    You can do this.
    data: str(15) type c value '123,678.00'.
    translate str using ', '.
    condense str no-gaps.
    ABAP related questions should be posted in the ABAP forum. 
    As I see you have done.
    need to print with out comma
    Regards,
    Rich Heilman
    Message was edited by: Rich Heilman

  • When I air print from my iPad, I can't limit the number of pages. It just says print and the number of copies and I end up with way more than I want. How do I set it to limit the pages?

    When I air print using FingerPrint from my ipad, it doesn't let me limit the number of pages, and I end up with more pages than I want. It asks if I want multiple copies, but it doesn't ask me number of pages, or which pages. Is there a way to do this?

    When you use an AirPrint compatible printer, you get this option for page range. You are using your computer as the server in order to print, so you probably have to set the range on the computer. While you can print from your printer with this app, I assume that it doesn't give you the same control that you get directly from the iPad when using an AirPrint printer.
    Read this from the FingerPrint support site. Selecting the page range would be part of the formatting of a print job.
    http://fingerprint-support.collobos.com/knowledgebase/articles/66972-i-can-t-for mat-the-print-job

  • How to printe with cardinal number? or ordinal number?

    As Subject, how to print with numbers on the bottom of each page? or on the bottom right/ bottom left? or on top of page? top right/top left?
    I am poor using Pages, still learning.

    Click in the Header or Footer:
    +Menu > Insert > Auto Page Numbers…+
    Peter

  • PIXMA MP610: Can Printing a large number of copies damage the printer head

    Hi!I want some suggestion, if some one give me nice suggestion it will be best for meI bought Canon Mp610 , for my thesis (which contain 400 pages inculding color and black pages), and require 10 copies meanwhile, 4000 pagesI decide print to thesis with 1, or in 5 actions , I need suggestion which  will be best for me  to print collective 5 copies or print one or two copy then give it rest for 15-30 minutes and then give action for other copy, but is time consuming,  but my colleague said me if you print 5 copies in signle or multiple actions, it  damage the printer head, and you will loss your printer. He said me to use Laer jet for black portion and for color use inkjet printer. I am worried about his suggestion because i will waste my lot pages which will be print in black then I will replace them with color pages. Please give me your kind suggestion Please  RegardsMuqeet Soomro 

    I know what you mean, this has to happen every month, and for some reason (orders from the bosses), i have to be at work until the whole job has finished printing incase a batch goes wrong so we can imediatly start reprinting, it used to be only from the Friday night until early Monday morning, so I'm also trying to get the job done a bit quicker, but i can't see that happening.
    The problem is that its all together 150 000 documents that we need to print that will be split up into these batches (within 5 days, monthly), the printer that we are printing to is an OCE, so it can handle big batches. the thing is that we use to print it from an AS400 through DOCOUT, so while the printer was printing one of these batches, it was busy spooling the next batch, which made it a bit quicker, but now this process has to move over to JAVA, and if i can the program to spool the jobs, i can start spooling while the previous one is printing. i even thought about writing a batch through the socket, in theory its almost like spooling, but i don't know how much RAM the OCE has.
    I also thought of merging the POSTSCRIPTS into one document, but that will take alot of time and space.

  • Need to PRINT with PANTONE spot colors  - PROBLEMS

    Hello!
    This is my first post here.
    I am from Poland and I designed artwork for a 12" vinyl. It is going to be pressed in the US and so will be the cover get printed there.
    This is my first abroad work... So far when i wanted to use Pantone for printing i prepared the artwork in CMYK and just noted (for the printer) which Pantone spot colors should be used. This is how it works here in Poland. But when i sent my artwork like this to the US printing plant - i got a reply that this is wrong and i need to prepare the files for spot color printing...
    I prepared the artwork in Photoshop CS4 and i put it on a template for printing in InDesign CS4.
    Meanwhile i got to know how to make new spot channels in Photoshop, but when i want to place that file on the template in InDesign - i get a message saying that i can only import RGB or CMYK files...
    I Need Your help!

    yeah, i knew that.
    i think i sorted it out now.
    i think my mistake was that i tried to import PSD files. But later on i saved them as EPS files i could import them to InDesign with the spot colrs.
    We'll see what the printing plant says.
    Should be good now.

  • I need help printing with HP laserjet 2200 and OS 10.6

    I need help setting up my HP laserjet 2200 and OS 10.6 -- I've downloaded and installed all the software and still can't print.

    Hey jeo1951,
    If you haven't already, try running through the recommended steps in the following article:
    Mac 101: Printing (Mac OS X v10.6)
    http://support.apple.com/kb/HT3771
    It should help you set up your printer.
    Welcome to Apple Support Communities!
    All the best,
    Delgadoh

  • Need to Print with color.

    My printer (HP Photosmart D110 series)  has new color cartridge, and is already Align. When I print,  It come out with any color the paper, just black and no color.  What Can I do?

    Hi,
    Try printing a Self-Test report to check rather the issue is ink or driver related:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00039556&cc=us&dlc=en&lc=en&product=4023246&tmp...
    If you do see colors printed correctly, access the printing preferences from the application use to print by clicking File > Print and then the Properties / Preferences / Settings button.
    Click the Color tab and ensure the driver is not configured to print as Grayscale or Black Ink only.
    If the hardware report does not include any color as well the cartridge might be faulty.
    Remove it and ensure you removed any tape from it, try following the steps below and check if that may help, if the same persists try replacing the color ink cartridge:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02002581&cc=us&dlc=en&lc=en&product=4023246&tmp...
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Need a table with asset number and document number

    Hi to all experts.
    Im in a support project. There is an issue in the customized report the total expense for february is coming 10,322 dollars which is 322 dollars extra it should be 10,000 .but i see the table ANEP the value is 10,322 dollars,when i check the corresponding document for the asset no in bseg table im unable to find any asset no ... what could be the problem ............

    Hi,
        In ANEk table ,check field BELNR . the number may be a material document no or Fi Doc no. if it is material doc no then try MIGO - Display -> doc info ->press FI Document.
    Or directly try with fb03.
    Or in BKPf table there will be field awkey. in that field give material doc no and material year combinely , then you will get FI Doc No. then go with bseg table.
    Regards,
    Ravi.

  • Need Help, Issue With Porting Number

    Hey I ported my number from sprint, but right now I have service on my iphone and my old sprint phone and if I send a text from iphone I get a response on sprint phone. Anyway I can fix this? Or will it work itself out with time?

    That is normal for porting your phone number, within a few more hours, it will all switch over to the iPhone, you will recieve a text message confirming once this is complete. So, just hang on to the Sprint phone a tiny bit longer, you're almost there!

  • TS1398 What app do I need to print with HP printer C309?

    What is a good third party app for setting up my Ipad to print to my wireless HP printer C309?

    You can also try the HP ePrint app. Here is a quick link with additional info and features.
    Best of Luck!
    I work with HP. However, my posts and opinions are my own.

  • Why do I need to activate (with serial number) the apps when opening??

    It is asking me if I want to initiate the 309 days trial version?? I am logged in on my Creative Cloud Accound with full license to all Apps!! 1. I have tried to log in and log out of my creative cloud and restart my iMac.
    tnx

  • Can a PDF be made to by default print with "flip on short edge" set if printed double-sided?

    I'm producing a 4-side, 1-sheet PDF booklet download. Our main target audience is professionals (not necessarily tech-profecient) who will download it and print it on regular office printers. Most modern office printers can print double-sided, so we expect people to print it on one sheet, fold it in the middle, and use it like that.
    This gives us a problem: the default setting for double-sided printing in Adobe Reader and Adobe Acrobat appears to be to flip on the long edge. For a folded booklet, this results in the centre pages printing upside down. I, personally, know how to change this setting - but our audience won't, and we've found that even within our own tightly controlled office network, the options for changing this setting are in different places for different people - so giving everyone who downloads it instructions on how to change the setting will be difficult. I'm tech profecient enough to confidently poke around in the various printer settings dialogs until I find it, but most of our audience won't be, and many people will get it wrong even with basic guidance telling them what to look for.
    The "Flip on long edge" default appears to be based on the assumption that printed documents are to be held and read portrait, regardless of how they are printed. Is there any way to set a PDF to instruct Adobe Reader etc that this document is to be read landscape (or, folded), so that it can know to flip on the short edge by default for this particular document?
    I'm not fussy about what software I use to create or edit the PDF. I'm using InDesign at the moment but will happily use Acrobat, or even hack the code of the PDF with a text editor, if that's what makes it work. I'm asking on the Adobe Reader board since it's not so much a question of how to set this, as whether there is anything in Adobe Reader that is actually capable of interpreting and acting on such information from a PDF.
    Another type of answer that could solve my problem is, is there some universal way to set "Flip on short edge" where the steps the user follows are the same regardless of whether they are using Reader or Acrobat, PC or Mac, and regardless of specific printer drivers or printer software?

    You should post here for Apple to get your feedback:
    http://www.apple.com/feedback/

  • Aperture is printing  with borders even though the setting is off

    Has anyone had this problem? All of a sudden Aperture is printing a fine rule when I try to print to Super B size. When I print the images letter size, there is no frame. Also, if I print the same image in Photoshop, I don't get the frame. I tried trashing my preferences but that didn't help. Could it be that I need to trash the printer preferences? Any help would be appreciated. I am ready to toss my machine out the window!

    Hi,
    I can only speak of the R1900 setup, but this may be of assistance.
    If you select straight Super B from the paper size dialogue in Aperture, it doesn't give you the option for expanding the print in the printer dialogue that you get in the printer driver. BUT... if you select the "Super B Borderless sheet feed" paper size, the controls in the printer driver for expanded printing become available.
    Good luck - you may have already found this option. Bummer about not getting it right though - this A3+ paper is not cheap!!

  • Printing report? Number of copies?

    I find that we are printing more and more copies of the same document on a regular basis (for example, 2nd copy, 3rd copy). This could be down to internal mail issues, lost paperwork etc
    Is there a report that I can run in SAP to highlight how many 2nd or 3rd copies I have printed?
    Printing the additional copies is a reasonably simple exercise - but can it be tracked in the SAP system so that we can monitor.
    Thanks

    Hello, take a look at this article. Unfortunately the Generate Report Get Data to Modify.vi was remove since RGT 1.1.3 release. That being said, we can try to find a workaround. See "Configuring a Printer Through the Windows Dialog in LabVIEW", open the GetPrinterSettings.vi, at the PrinterSettings property node you can select the from/to page. I hope this helps.
    Alejandro | Academic Program Engineer | National Instruments

Maybe you are looking for

  • JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CPIC-CALL: CMRCV on convId

    Hi all<BR> <BR> Somtimes I am getting this kind of error message within Portal...<BR> <BR> Full Message Text:<BR> <BR> failed JCO execute function; stack trace: com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CPIC-CALL: CMRCV on convId:

  • How to creat background user.

    How to creat background unser in BW? I inputed transaction code: SBIW ,and SPRO.But I haven't found 'Creat Background users for link to SAP'.How to creat this user? thanks.

  • Set text issue

    I have made a picture rotator for my website, but when I click on the image (which initiates the rotation to the next picture) the javascript SHOULD change the text of the specified layer, but instead of changing the HTML, it just posts the code on t

  • Oracle Database down /failover clause ?

    hi I am collecting the information regarding oracle database down / failover clouses , so all of you requested kindly send me your experience regarding Oracle database down/failover reason/clause. thanks in advance regards

  • PCM modulation / simulación de modulación PCM

    He estado trabajando en la simulación de una modulación/demodulación PCM simulando la señal de información (sin adquisición de datos). Pero soy principiante en programación en Labview, la modulación y asignación de código binario está hecha pero no h