< prev index next >

src/java.desktop/share/classes/javax/print/DocFlavor.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 177  * from {@link DocFlavor#hostEncoding DocFlavor.hostEncoding}
 178  * This may not always be the primary IANA name but is guaranteed to be
 179  * understood by this VM.
 180  * For common flavors, the pre-defined *HOST DocFlavors may be used.
 181  * <p>
 182  * See <a href="../../java/lang/package-summary.html#charenc">
 183  * character encodings</a> for more information on the character encodings
 184  * supported on the Java platform.
 185  * <HR>
 186  * <h3>Recommended DocFlavors</h3>
 187  * <P>
 188  * The Java Print Service API does not define any mandatorily supported
 189  * DocFlavors.
 190  * However, here are some examples of MIME types that a Java Print Service
 191  * instance might support for client formatted print data.
 192  * Nested classes inside class DocFlavor declare predefined static
 193  * constant DocFlavor objects for these example doc flavors; class DocFlavor's
 194  * constructor can be used to create an arbitrary doc flavor.
 195  * <UL>
 196  * <LI>Preformatted text
 197  * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">


 198  * <TR>
 199  *  <TH>MIME-Type</TH><TH>Description</TH>
 200  * </TR>


 201  * <TR>
 202  * <TD>{@code "text/plain"}</TD>
 203  * <TD>Plain text in the default character set (US-ASCII)</TD>
 204  * </TR>
 205  * <TR>
 206  * <TD><code>"text/plain; charset=<I>xxx</I>"</code></TD>
 207  * <TD>Plain text in character set <I>xxx</I></TD>
 208  * </TR>
 209  * <TR>
 210  * <TD>{@code "text/html"}</TD>
 211  * <TD>HyperText Markup Language in the default character set (US-ASCII)</TD>
 212  * </TR>
 213  * <TR>
 214  * <TD><code>"text/html; charset=<I>xxx</I>"</code></TD>
 215  * <TD>HyperText Markup Language in character set <I>xxx</I></TD>
 216  * </TR>

 217  * </TABLE>
 218  * <P>
 219  * In general, preformatted text print data is provided either in a character
 220  * oriented representation class (character array, String, Reader) or in a
 221  * byte oriented representation class (byte array, InputStream, URL).
 222  *
 223  *  <LI>Preformatted page description language (PDL) documents
 224  *
 225  * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">


 226  * <TR>
 227  *  <TH>MIME-Type</TH><TH>Description</TH>
 228  * </TR>
 229  *<TR>


 230  * <TD>{@code "application/pdf"}</TD>
 231  * <TD>Portable Document Format document</TD>
 232  * </TR>
 233  * <TR>
 234  * <TD>{@code "application/postscript"}</TD>
 235  * <TD>PostScript document</TD>
 236  * </TR>
 237  * <TR>
 238  * <TD>{@code "application/vnd.hp-PCL"}</TD>
 239  * <TD>Printer Control Language document</TD>
 240  * </TR>

 241  * </TABLE>
 242  * <P>
 243  * In general, preformatted PDL print data is provided in a byte oriented
 244  * representation class (byte array, InputStream, URL).
 245  *
 246  *  <LI>Preformatted images
 247  *
 248  * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">


 249  * <TR>
 250  *  <TH>MIME-Type</TH><TH>Description</TH>
 251  * </TR>
 252  *

 253  * <TR>
 254  * <TD>{@code "image/gif"}</TD>
 255  * <TD>Graphics Interchange Format image</TD>
 256  * </TR>
 257  * <TR>
 258  * <TD>{@code "image/jpeg"}</TD>
 259  * <TD>Joint Photographic Experts Group image</TD>
 260  * </TR>
 261  * <TR>
 262  * <TD>{@code "image/png"}</TD>
 263  * <TD>Portable Network Graphics image</TD>
 264  * </TR>

 265  * </TABLE>
 266  * <P>
 267  * In general, preformatted image print data is provided in a byte oriented
 268  * representation class (byte array, InputStream, URL).
 269  *
 270  *  <LI>Preformatted autosense print data
 271  *
 272  * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">


 273  * <TR>
 274  *  <TH>MIME-Type</TH><TH>Description</TH>
 275  * </TR>
 276  *

 277  * <TR>
 278  * <TD>{@code "application/octet-stream"}</TD>
 279  * <TD>The print data format is unspecified (just an octet stream)</TD>


 280  * </TABLE>
 281  * <P>
 282  * The printer decides how to interpret the print data; the way this
 283  * "autosensing" works is implementation dependent. In general, preformatted
 284  * autosense print data is provided in a byte oriented representation class
 285  * (byte array, InputStream, URL).
 286  * </UL>
 287  *
 288  * <HR>
 289  * <H3>Service Formatted Print Data</H3>
 290  * <P>
 291  * For <B>service formatted print data</B>, the Java Print Service instance
 292  * determines the print data format. The doc flavor's representation class
 293  * denotes an interface whose methods the {@code DocPrintJob} invokes to
 294  * determine the content to be printed -- such as a renderable image
 295  * interface or a Java printable interface.
 296  * The doc flavor's MIME type is the special value
 297  * {@code "application/x-java-jvm-local-objectref"} indicating the client
 298  * will supply a reference to a Java object that implements the interface
 299  * named as the representation class.


   1 /*
   2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 177  * from {@link DocFlavor#hostEncoding DocFlavor.hostEncoding}
 178  * This may not always be the primary IANA name but is guaranteed to be
 179  * understood by this VM.
 180  * For common flavors, the pre-defined *HOST DocFlavors may be used.
 181  * <p>
 182  * See <a href="../../java/lang/package-summary.html#charenc">
 183  * character encodings</a> for more information on the character encodings
 184  * supported on the Java platform.
 185  * <HR>
 186  * <h3>Recommended DocFlavors</h3>
 187  * <P>
 188  * The Java Print Service API does not define any mandatorily supported
 189  * DocFlavors.
 190  * However, here are some examples of MIME types that a Java Print Service
 191  * instance might support for client formatted print data.
 192  * Nested classes inside class DocFlavor declare predefined static
 193  * constant DocFlavor objects for these example doc flavors; class DocFlavor's
 194  * constructor can be used to create an arbitrary doc flavor.
 195  * <UL>
 196  * <LI>Preformatted text
 197  * <table class="plain">
 198  * <caption style="display:none">MIME-Types and their descriptions</caption>
 199  * <thead>
 200  * <TR>
 201  *  <TH>MIME-Type</TH><TH>Description</TH>
 202  * </TR>
 203  * </thead>
 204  * <tbody>
 205  * <TR>
 206  * <TD>{@code "text/plain"}</TD>
 207  * <TD>Plain text in the default character set (US-ASCII)</TD>
 208  * </TR>
 209  * <TR>
 210  * <TD><code>"text/plain; charset=<I>xxx</I>"</code></TD>
 211  * <TD>Plain text in character set <I>xxx</I></TD>
 212  * </TR>
 213  * <TR>
 214  * <TD>{@code "text/html"}</TD>
 215  * <TD>HyperText Markup Language in the default character set (US-ASCII)</TD>
 216  * </TR>
 217  * <TR>
 218  * <TD><code>"text/html; charset=<I>xxx</I>"</code></TD>
 219  * <TD>HyperText Markup Language in character set <I>xxx</I></TD>
 220  * </TR>
 221  * </tbody>
 222  * </TABLE>
 223  * <P>
 224  * In general, preformatted text print data is provided either in a character
 225  * oriented representation class (character array, String, Reader) or in a
 226  * byte oriented representation class (byte array, InputStream, URL).
 227  *
 228  *  <LI>Preformatted page description language (PDL) documents
 229  *
 230  * <table class="plain">
 231  * <caption style="display:none">MIME-Types and their descriptions</caption>
 232  * <thead>
 233  * <TR>
 234  *  <TH>MIME-Type</TH><TH>Description</TH>
 235  * </TR>
 236  * </thead>
 237  * <tbody>
 238  * <TR>
 239  * <TD>{@code "application/pdf"}</TD>
 240  * <TD>Portable Document Format document</TD>
 241  * </TR>
 242  * <TR>
 243  * <TD>{@code "application/postscript"}</TD>
 244  * <TD>PostScript document</TD>
 245  * </TR>
 246  * <TR>
 247  * <TD>{@code "application/vnd.hp-PCL"}</TD>
 248  * <TD>Printer Control Language document</TD>
 249  * </TR>
 250  * </tbody>
 251  * </TABLE>
 252  * <P>
 253  * In general, preformatted PDL print data is provided in a byte oriented
 254  * representation class (byte array, InputStream, URL).
 255  *
 256  *  <LI>Preformatted images
 257  *
 258  * <table class="plain">
 259  * <caption style="display:none">MIME-Types and their descriptions</caption>
 260  * <thead>
 261  * <TR>
 262  *  <TH>MIME-Type</TH><TH>Description</TH>
 263  * </TR>
 264  * </thead>
 265  * <tbody>
 266  * <TR>
 267  * <TD>{@code "image/gif"}</TD>
 268  * <TD>Graphics Interchange Format image</TD>
 269  * </TR>
 270  * <TR>
 271  * <TD>{@code "image/jpeg"}</TD>
 272  * <TD>Joint Photographic Experts Group image</TD>
 273  * </TR>
 274  * <TR>
 275  * <TD>{@code "image/png"}</TD>
 276  * <TD>Portable Network Graphics image</TD>
 277  * </TR>
 278  * </tbody>
 279  * </TABLE>
 280  * <P>
 281  * In general, preformatted image print data is provided in a byte oriented
 282  * representation class (byte array, InputStream, URL).
 283  *
 284  *  <LI>Preformatted autosense print data
 285  *
 286  * <table class="plain">
 287  * <caption style="display:none">MIME-Types and their descriptions</caption>
 288  * <thead>
 289  * <TR>
 290  *  <TH>MIME-Type</TH><TH>Description</TH>
 291  * </TR>
 292  * </thead>
 293  * <tbody>
 294  * <TR>
 295  * <TD>{@code "application/octet-stream"}</TD>
 296  * <TD>The print data format is unspecified (just an octet stream)</TD>
 297  * </TR>
 298  * </tbody>
 299  * </TABLE>
 300  * <P>
 301  * The printer decides how to interpret the print data; the way this
 302  * "autosensing" works is implementation dependent. In general, preformatted
 303  * autosense print data is provided in a byte oriented representation class
 304  * (byte array, InputStream, URL).
 305  * </UL>
 306  *
 307  * <HR>
 308  * <H3>Service Formatted Print Data</H3>
 309  * <P>
 310  * For <B>service formatted print data</B>, the Java Print Service instance
 311  * determines the print data format. The doc flavor's representation class
 312  * denotes an interface whose methods the {@code DocPrintJob} invokes to
 313  * determine the content to be printed -- such as a renderable image
 314  * interface or a Java printable interface.
 315  * The doc flavor's MIME type is the special value
 316  * {@code "application/x-java-jvm-local-objectref"} indicating the client
 317  * will supply a reference to a Java object that implements the interface
 318  * named as the representation class.


< prev index next >