Package javax.print.attribute

Examples of javax.print.attribute.DocAttributeSet


                    jobAttrSet.add(attrs[i]);
                }
            }
        }

        DocAttributeSet docSet = doc.getAttributes();
        if(docSet != null){
            attrs = docSet.toArray();
            for(int i = 0; i < attrs.length; i++){
                if(attrs[i] instanceof PrintRequestAttribute){
                    reqAttrSet.add(attrs[i]);
                }
                if(attrs[i] instanceof PrintJobAttribute){
                    jobAttrSet.add(attrs[i]);
                }
            }
        }

        /* add the user name to the job */
        String userName = "";
        try{
            userName = System.getProperty("user.name");
        }catch(SecurityException se){
        }

        if(userName == null || userName.equals("")){
            RequestingUserName ruName = (RequestingUserName)reqSet.get(RequestingUserName.class);
            if(ruName != null){
                jobAttrSet.add(new JobOriginatingUserName(ruName.getValue(), ruName.getLocale()));
            }else{
                jobAttrSet.add(new JobOriginatingUserName("", null));
            }
        }else{
            jobAttrSet.add(new JobOriginatingUserName(userName, null));
        }

        /*
         * if no job name supplied use doc name (if supplied), if none and its a URL use that, else finally anything ..
         */
        if(jobAttrSet.get(JobName.class) == null){
            JobName jobName;
            if(docSet != null && docSet.get(DocumentName.class) != null){
                DocumentName docName = (DocumentName)docSet.get(DocumentName.class);
                jobName = new JobName(docName.getValue(), docName.getLocale());
                jobAttrSet.add(jobName);
            }else{
                String str = "JPS Job:" + doc;
                try{
View Full Code Here


                    }
                };
                job.addPrintJobListener(pjlistener);
                PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();

                DocAttributeSet das = new HashDocAttributeSet();
                Doc doc = new SimpleDoc(printIt, flavor, das);
                try {  
                        job.print(doc, pras);
                    } catch (PrintException pe) {
                        pe.printStackTrace();
View Full Code Here

                };
                job.addPrintJobListener(pjlistener);
                PrintRequestAttributeSet pras =
                new HashPrintRequestAttributeSet();

                DocAttributeSet das = new HashDocAttributeSet();
                Doc doc = new SimpleDoc(printIt, flavor, das);
                try {  
                        job.print(doc, pras);
                    } catch (PrintException pe) {
                        pe.printStackTrace();
View Full Code Here

                model.removeRow(0);
                a=model.getRowCount();
            }                          

               
            DocAttributeSet das = new HashDocAttributeSet();
               
            dispose();
        }else{
            this.getToolkit().beep();
            JOptionPane.showMessageDialog(this, "Please pay first");
View Full Code Here

TOP

Related Classes of javax.print.attribute.DocAttributeSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.