1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <html>
3 <head>
4 <title>javax.print.attribute package</title>
5 <!--
6 Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
7 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8
9 This code is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License version 2 only, as
11 published by the Free Software Foundation. Oracle designates this
12 particular file as subject to the "Classpath" exception as provided
13 by Oracle in the LICENSE file that accompanied this code.
14
15 This code is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 version 2 for more details (a copy is included in the LICENSE file that
19 accompanied this code).
20
21 You should have received a copy of the GNU General Public License version
22 2 along with this work; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24
25 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
26 or visit www.oracle.com if you need additional information or have any
381 aset.add(MediaSize.A4);
382 aset.add(Sides.DUPLEX);
383
384 PrintService[] services =
385 PrintServiceLookup.lookupPrintServices(psInFormat, aset);
386 if (services.length > 0) {
387 DocPrintJob job = services[0].createPrintJob();
388 try {
389 job.print(myDoc, aset);
390 } catch (PrintException pe) {}
391 }
392 </pre>
393 </blockquote>
394 <P>
395 Please note: In the javax.print APIs, a null reference parameter to methods
396 is incorrect unless explicitly documented on the method as having a meaningful
397 interpretation. Usage to the contrary is incorrect coding and may result
398 in a run time exception either immediately or at some later time.
399 IllegalArgumentException and NullPointerException are examples of
400 typical and acceptable run time exceptions for such cases.
401 <P>
402 @since 1.4
403 </body>
404 </html>
|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <html>
3 <head>
4 <title>javax.print.attribute package</title>
5 <!--
6 Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
7 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8
9 This code is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License version 2 only, as
11 published by the Free Software Foundation. Oracle designates this
12 particular file as subject to the "Classpath" exception as provided
13 by Oracle in the LICENSE file that accompanied this code.
14
15 This code is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 version 2 for more details (a copy is included in the LICENSE file that
19 accompanied this code).
20
21 You should have received a copy of the GNU General Public License version
22 2 along with this work; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24
25 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
26 or visit www.oracle.com if you need additional information or have any
381 aset.add(MediaSize.A4);
382 aset.add(Sides.DUPLEX);
383
384 PrintService[] services =
385 PrintServiceLookup.lookupPrintServices(psInFormat, aset);
386 if (services.length > 0) {
387 DocPrintJob job = services[0].createPrintJob();
388 try {
389 job.print(myDoc, aset);
390 } catch (PrintException pe) {}
391 }
392 </pre>
393 </blockquote>
394 <P>
395 Please note: In the javax.print APIs, a null reference parameter to methods
396 is incorrect unless explicitly documented on the method as having a meaningful
397 interpretation. Usage to the contrary is incorrect coding and may result
398 in a run time exception either immediately or at some later time.
399 IllegalArgumentException and NullPointerException are examples of
400 typical and acceptable run time exceptions for such cases.
401
402 @since 1.4
403 </body>
404 </html>
|