124 aset.add(new Copies(5));
125 aset.add(MediaSize.A4);
126 aset.add(Sides.DUPLEX);
127 PrintService[] services =
128 PrintServiceLookup.lookupPrintServices(psInFormat, aset);
129 if (services.length > 0) {
130 DocPrintJob job = services[0].createPrintJob();
131 try {
132 job.print(myDoc, aset);
133 } catch (PrintException pe) {}
134 }
135 </pre>
136 </blockquote>
137 <P>
138 Please note: In the javax.print APIs, a null reference parameter to methods
139 is incorrect unless explicitly documented on the method as having a meaningful
140 interpretation. Usage to the contrary is incorrect coding and may result
141 in a run time exception either immediately or at some later time.
142 IllegalArgumentException and NullPointerException are examples of
143 typical and acceptable run time exceptions for such cases.
144 <P>
145 @since 1.4
146 </body>
147 </html>
|
124 aset.add(new Copies(5));
125 aset.add(MediaSize.A4);
126 aset.add(Sides.DUPLEX);
127 PrintService[] services =
128 PrintServiceLookup.lookupPrintServices(psInFormat, aset);
129 if (services.length > 0) {
130 DocPrintJob job = services[0].createPrintJob();
131 try {
132 job.print(myDoc, aset);
133 } catch (PrintException pe) {}
134 }
135 </pre>
136 </blockquote>
137 <P>
138 Please note: In the javax.print APIs, a null reference parameter to methods
139 is incorrect unless explicitly documented on the method as having a meaningful
140 interpretation. Usage to the contrary is incorrect coding and may result
141 in a run time exception either immediately or at some later time.
142 IllegalArgumentException and NullPointerException are examples of
143 typical and acceptable run time exceptions for such cases.
144
145 @since 1.4
146 </body>
147 </html>
|