1574 lines · 57.7 KB · HTML
RawDownload
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Details of Ghostscript output devices</title><!-- $Id: Devices.htm,v 1.90 2005/10/20 19:46:23 ray Exp $ --><!-- Originally: devices.txt --><link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style"></head> <body><!-- [1.0 begin visible header] ============================================ --> <!-- [1.1 begin headline] ================================================== --> <h1>Details of Ghostscript output devices</h1> <!-- [1.1 end headline] ==================================================== --> <!-- [1.2 begin table of contents] ========================================= --> <h2>Table of contents</h2> <blockquote><ul><li><a href="#Measurements">Notes on measurements</a><li><a href="#File_formats">Image file formats</a><ul><li><a href="#PNG">PNG file format</a><li><a href="#JFIF">JPEG file format (JFIF)</a><li><a href="#PNM">PNM file format</a><li><a href="#TIFF">TIFF file formats</a><li><a href="#fax">fax file formats</a><li><a href="#BMP">BMP file format</a><li><a href="#PCX">PCX file format</a><li><a href="#PSD">PSD file format (DeviceN color model)</a></ul><li><a href="#High-level">High level formats</a><ul><li><a href="#PDF">PDF file output</a><li><a href="#PS">PostScript file output</a><li><a href="#EPS">EPS file output</a><li><a href="#PXL">PCL-XL file output</a></ul><li><a href="#Display_devices">Display devices</a><ul><li><a href="#x11_devices">X Window System</a><li><a href="#display_device">display device (MS Windows, OS/2, gtk+)</a></ul><li><a href="#IJS">IJS - Inkjet and other raster devices</a><li><a href="#Rinkj">Rinkj - Resplendent inkjet driver</a><li><a href="#HP_ijs">HP Deskjet official drivers</a><li><a href="#gimp-print">Gimp-Print driver collection</a><li><a href="#Win">MS Windows printers</a><li><a href="#SPARCprinter">Sun SPARCprinter</a><ul><li><a href="#SPARC_install">Installation</a><li><a href="#SPARC_problems">Problems</a></ul><li><a href="#Apple">Apple dot matrix printer</a><li><a href="#Test">Test devices</a><ul><li><a href="#Permute">Permutation (DeviceN color model)</a><li><a href="#SPOT">spotcmyk (DeviceN color model)</a> <li><a href="#XCF">XCF (DeviceN color model)</a><li><a href="#bitraw">Raw 'bit' devices</a></ul></ul></blockquote> <!-- [1.2 end table of contents] =========================================== --> <!-- [1.3 begin hint] ====================================================== --> <p>For other information, see the <a href="Readme.htm">Ghostscriptoverview</a>.  You may also be interested in <a href="Make.htm">how tobuild Ghostscript</a> and <a href="Install.htm">install it</a>, as well asthe description of the <a href="Drivers.htm">driver interface</a>. <p>Documentation for some older, superceded devices has been moved to<a href="Deprecated.htm">another document</a>. In general such devices are deprecatedand will be removed in future versions of Ghostscript. In general all older printerdrivers can be replaced by the ijs interface and one of the available 3rd party rasterdriver collections. We recommend moving to the ijs device for all such printing.</p> <!-- [1.3 end hint] ======================================================== --> <hr> <!-- [1.0 end visible header] ============================================== --> <!-- [2.0 begin contents] ================================================== --> <h2><a name="Measurements"></a>Notes on measurements</h2> <p>Several different important kinds of measures appear throughout thisdocument: inches, centimeters and millimeters, points, and bits per pixel. <dl> <dt>Centimeters and millimeters</dt><dd>ISO standard paper sizes such as A4 and A3 are commonly represented inthe SI units of centimeters and millimeters.  Centimeters are abbreviated<dfn><abbr>cm</abbr></dfn>, millimeters <dfn><abbr>mm</abbr></dfn>.  ISO A4 paper isquite close to 210&times;297 millimeters (approximately 8.3&times;11.7inches).</dd> <dt>Inches</dt><dd>1 inch equals 2.54 centimeters.  The inch measure is sometimesrepresented by <dfn><abr>in</abr></dfn> or a quotation mark (<abr>&quot;</abr>) to the rightof a measure, like 8.5in or 8.5&quot;. U.S. "letter" paper is exactly8.5in&times;11in, approximately 21.6cm&times;27.9cm.  (See in the usagedocumentation all the <a href="Use.htm#Known_paper_sizes">paper sizespredefined in Ghostscript</a>.)</dd> <dt>Points</dt><dd>Points are a measure traditionally used in the printing trade and nowin PostScript, which specifies exactly 72 points per inch (approximately28.35 per centimeter).  The <a href="Use.htm#Known_paper_sizes">paper sizesknown to Ghostscript</a> are defined in the initialization file<tt>gs_statd.ps</tt> in terms of points.</dd> <dt>Dots per inch</dt><dd>Dots per inch or <dfn><abbr>dpi</abbr></dfn> is the common measure of printing resolution in the US.</dd> <dt>Bits per pixel</dt><dd>Commonly abbreviated <dfn><abbr>bpp</abbr></dfn> this is the number of digital bits used to represent the color of each pixel. This is also referredto as 'bit depth' or 'pixel depth'.</dd> </dl> <hr> <h2><a name="File_formats"></a>Image file formats</h2> <p>Ghostscript supports output to a variety of image file formatsand is widely used for rasterizing postscript and pdf files.A collection of such formats ('output devices' in Ghostscript terminology)are described in this section.</p> <p>Here are some commonly useful driver options that apply to all raster drivers.Options specific to particular file formats are described in their respectivesections below.</p> <blockquote><dl> <dt>-sOutputFile=<em>filename</em></dt><dd><p>This is a general option telling Ghostscript what to name the output. It can either be a single filename '<tt>tiger.png</tt>' or a template'<tt>figure-%03d.jpg</tt>' where the <tt>%03d</tt> is replaced by the page number.</p>  <dt>-r<em>res</em></dt><dt>-r<em>xres</em>x<em>yres</em></dt><dd><p>This option sets the resolution of the output file in dots per inch.The default value if you don't specify this options is usually 72 <abbr>dpi</abbr>.</p></dd> <dt>-dTextAlphaBits=<em>n</em></dt><dt>-dGraphicsAlphaBits=<em>n</em></dt><dd><p>These options control the use of subsample antialiasing. Their use is highly recommendedfor producing high quality rasterizations of the input files. The size of the subsamplingbox <em>n</em> should be 4 for optimum output, but smaller values can be used for fasterrendering. Antialiasing is enabled separately for text and graphics content.</p></dd> </dl></blockquote> <p>It is also conventional to call Ghostscript with the '<tt>-dSAFER -dBATCH -dNOPAUSE</tt>' trioof options when rasterizing to a file. These suppress interactive prompts and enable some security checks on the file to be run. Please see the <a href="Use.htm">Use documentation</a>for a complete description.</p> <h3><a name="PNG"></a>PNG file format</h3> <p><acronym>PNG</acronym> (pronounced 'ping') stands for Portable Network Graphics,and is the recommended format for high-quality images. It supports full qualitycolor and transparency, offers excellent lossless compression of the image data,and is widely supported. Please see the <a href="http://www.libpng.org/pub/png/pngintro.html" class="offsite">PNG website</a>for a complete description of the format.</p> <p>Ghostscript provides a variety of devices for <acronymn>PNG outputvarying by bit depth. For normal use we recommend <tt>png16m</tt> for 24-bit RGB color,or <tt>pnggray</tt> for grayscale. The png256, png16 and pngmono devices respectivelyprovide 8-bit color, 4-bit color and black-and-white for special needs.</p> <p>The pngalpha device is 32-bit RGBA color with transparency indicating pixel coverage.  The background is transparent unlessit has been explicitly filled.  PDF 1.4 transparent files do notgive a transparent background with this device.  Text and graphics anti-aliasing are enabled by default.</p> <h4>Options</h4> <p>The pngalpha device has one option. The other png devices have no special options.</p> <blockquote><dl><dt><b><tt>-dBackgroundColor=</tt></b><b><em>16#RRGGBB</em></b> (RGB color, default white = 16#ffffff)<dd>For the <tt>pngalpha</tt> device only, set the suggested background color in the PNG bKGD chunk.  When a program reading a PNG file does not support alphatransparency, the PNG library converts the image usingeither a background color if supplied by the programor the bKGD chunk.One common web browser has this problem, so when using<b><tt>&lt;body bgcolor="CCCC00"&gt;</tt></b> on a web pageyou would need to use <b><tt>-dBackgroundColor=16#CCCC00</tt></b>when creating alpha transparent PNG images for use on thepage.</dl></blockquote> <h4>Examples</h4> <p>Examples of how to use Ghostscript to convert postscript to PNG image files: <blockquote><pre> <kbd>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 \      -sOutputFile=tiger.png examples/tiger.png</kbd>       <kbd>gs -dSAFER -dBATCH -dNOPAUSE -r150 -sDEVICE=pnggray -dTextAlphaBits=4 \      -sOutputFile=doc-%02d.png doc.pdf</kbd></pre></blockquote><p></p>  <h3><a name="JFIF"></a>JPEG file format (JFIF)</h3> <p>Ghostscript includes output drivers that can produce jpeg filesfrom postscript or pdf images. These are the <tt>jpeg</tt> and <tt>jpeggray</tt> devices. <p>Technically these produce <a href="http://www.ijg.org/">Independent JPEG Group</a>JFIF (JPEG File Interchange Format) files, the common sort found on the web.</p> <p><strong>Please note</strong> thatJPEG is a compression method specifically intended for continuous-toneimages such as photographs, not for graphics, and it is therefore quiteunsuitable for the vast majority of page images produced with PostScript.For anything other than pages containing simple images the lossy compressionof the jpeg format will result in poor quality output regardless of the input.To learn more about the distinction, consult a reference about uses and abuses of JPEG,such as the JPEG FAQ <blockquote><a href="http://www.faqs.org/faqs/jpeg-faq/" class="offsite">http://www.faqs.org/faqs/jpeg-faq/</a></blockquote> <h4>Examples</h4> <p>You can use the JPEG output drivers -- <b><tt>jpeg</tt></b> to producecolor JPEG files and <b><tt>jpeggray</tt></b> for grayscale JPEGs -- thesame as other file-format drivers: by specifying the device name and anoutput file name, for example <blockquote><pre><kbd>gs -sDEVICE=jpeg -sOutputFile=foo.jpg foo.ps</kbd></pre></blockquote> <h4>Options</h4> <p>The JPEG devices support several special parameters to control the JPEG"quality setting" (DCT quantization level).</p> <blockquote><dl><dt><b><tt>-dJPEGQ=</tt></b><b><em>N</em></b> (integer from 0 to 100, default 75)<dd>Set the quality level <b><em>N</em></b> according to the widely usedIJG quality scale, which balances the extent of compression against thefidelity of the image when reconstituted.  Lower values drop moreinformation from the image to achieve higher compression, and thereforehave lower quality when reconstituted. <dt><b><tt>-dQFactor=</tt></b><b><em>M</em></b> (float from 0.0 to 1.0)<dd>Adobe's QFactor quality scale, which you may use in place of<b><tt>JPEGQ</tt></b> above.  The QFactor scale is used by PostScript'sDCTEncode filter but is nearly unheard-of elsewhere.</dl></blockquote> <p>At this writing the default JPEG quality level of 75 is equivalent to<b><tt>-dQFactor=0.5</tt></b>, but the JPEG default might change in thefuture.  There is currently no support for any additional JPEGcompression options, such as the other DCTEncode filter parameters.</p>  <h3><a name="PNM"></a>PNM</h3> <p>The PNM (portable network map) family of formats are very simpleuncompressed image formats commonly used on unix-like systems. Theyare particularly useful for testing or as input to an external conversionutility.</p> <p>A wide variety of data formats and depths is supported. Devices include<tt>pbm   pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw pkm pkmraw pksm   pksmraw</tt>.</p> <h3><a name="TIFF"></a>TIFF file formats</h3> <p><acronym>TIFF</acronym> is a loose collection of formats, now largelysuperceded by <acronym>PNG</acronym> except in applications where backwardcompatibility or special compression is required. The <acronym>TIFF</acronym> file format is described in the<a href="http://partners.adobe.com/asn/developer/pdfs/tn/TIFF6.pdf" class="offsite">TIFF 6.0 Specification</a> published by Adobe Systems Incorporated.</p> <p>There are two unrelated sets of TIFF drivers.  There are five color TIFFdrivers that produce uncompressed output: <blockquote><dl><dt><b><tt>tiffgray</tt></b><dd>Produces 8-bit gray output.<dt><b><tt>tiff12nc</tt></b><dd>Produces 12-bit RGB output (4 bits per component).<dt><b><tt>tiff24nc</tt></b><dd>Produces 24-bit RGB output (8 bits per component).<dt><b><tt>tiff32nc</tt></b><dd>Produces 32-bit CMYK output (8 bits per component).<dt><b><tt>tiffsep</tt></b><dd>The tiffsep device creates multiple output files.  The device creates a single32 bit composite CMYK file (tiff32nc format) and multiple tiffgray files.A tiffgray file is created for each separation. <p>The file specified via the OutputFile command line parameter will contain CMYK data. This data is based upon the CMYK data within the file plus an equivalent CMYK color for each spot colors which is present. The equivalentCMYK color for each spot colors is determined using the alternate tint transformfunction specified in Separation and DeviceN color spaces. Since this file is created based upon having color planes for each colorant, thefile will correctly represent the appearance of overprinting with spot colors. <p>File names for the separations for theCMYK colorants are created by appending '.Cyan.tif', '.Magenta.tif''.Yellow.tif' or '.Black.tif' to the to the end of the file namespecified via the OutputFile parameter.  File names for the spotcolor separation files are created by appending '.sn.tif' (where nis the spot color number, see below) to the end of the file name specified viathe OutputFile parameter. <p>Internally each spot color is assigned a spot color number.  Thesenumbers start with 0 for the first spot color.  The spot colornumbers are assigned in the same order as the names are printed tostderr (see below).  This order also matches the ordering in theSeparationColorNames list, if this parameter is specified.  Thespot color numbers are not affected by the SeparationOrder parameter. <p>The names of spot colors may be specified via the SeparationColorNames deviceparameters.  Or the tiffsep device will automatically recognize spot colornames if <b><tt>-dMaxSeparations=8</tt></b> is specified on thecommand line. <p>If only a subset of the colorants for a file is desired then the separationsto be output can be selected via the SeparationOrderdevice parameter.  When colorants are selected via theSeparationOrder parameter, the composite CMYK output containsthe equivalent CMYK data only for the selected colorants.   <p>The tiffsep device also prints the names of any spot colorsdetected within a document to stderr.  (stderr is also use for theoutput from the bbox device.)  For each spot color the name ofthe color is printed preceded by '%%SeparationName:  '.  Thisprovides a simple mechanism for users and external applications to be informed aboutthe names of spot colors with a document. <p>Ghostscript currently limits the size of a pixel to 64 bits.Since the tiffsep device uses 8 bits per colorant,  the device can handlea maximum of 8 colorants per pass.  However it is possible tohandle more than 8 colorants by doing multiple passes.  For eachpass after the first one, the names of all of the separations needto be specified via the SeparationColorNames parameter and thenames of the desired separations need to be specified via theSeparationOrder parameter.  It ispossible to create an overall CMYK composite for more than 8colorants by then adding together (via an external application likeimagemagick) the composite CMYK output files from the individualGhostscript passes.</dl></blockquote> <p>The remaining TIFF drivers all produce black-and-white output with differentcompression modes: <blockquote><dl><dt><b><tt>tiffcrle</tt></b><dd>G3 fax encoding with no EOLs<dt><b><tt>tiffg3</tt></b><dd>G3 fax encoding with EOLs<dt><b><tt>tiffg32d</tt></b><dd>2-D G3 fax encoding<dt><b><tt>tiffg4</tt></b><dd>G4 fax encoding<dt><b><tt>tifflzw</tt></b><dd>LZW-compatible (tag = 5) compression<dt><b><tt>tiffpack</tt></b><dd>PackBits (tag = 32773) compression</dl></blockquote>  <h4>Options</h4> <p>The black-and-white TIFF drivers support creation of files that arecomprised of more than a single strip.  Multi-strip files reduce the memoryrequirement on the reader, since readers need only store and process onestrip at a time.  These drivers provide two parameters beyond the standardset: <blockquote><dl><dt><b><tt>-dMaxStripSize=</tt><em>N</em></b> (non-negative integer; default = 0)<dd>Set the maximum (uncompressed) size of a strip. <dt><b><tt>-dAdjustWidth</tt><em>state</em></b> (0 or 1; default = 1)<dd>If this option set then if the requested page width is close to either A4 (1728 columns) or B4 (2048 columns), set the page width to A4 or B4 respectively.This behavior is the default. Pass -dAdjustWidth=0 to turn off this behavior.</dl></blockquote> <p>The TIFF 6.0 specification, Section 7, page 27, recommends that the size ofeach strip be about 8 Kbytes.  As an example, to generate the 'tiger' intiffg4 format that has the recommended strip size, use: <blockquote><pre>gs -sDEVICE=tiffg4 -sOutputFile=tiger.tiff -dMaxStripSize=8192 examples/tiger.eps</pre></blockquote> <p>If the value of the <tt>MaxStripSize</tt> parameter is smaller than asingle image row, then no error will be generated, and the TIFF file will begenerated correctly using one row per strip.  Note that smaller strip sizesincrease the size of the file by increasing the size of the StripOffsets andStripByteCounts tables, and by reducing the effectiveness of the compressionwhich must start over for each strip. <p>If the value of MaxStripSize is 0 (the default), then the entire image willbe a single strip. <p>Since v. 8.51 the logical order of bits within a byte, FillOrder, tag = 266 iscontrolled by a parameter: <blockquote><dl><dt><b><tt>-dFillOrder=</tt><em>1 | 2 </em></b> (default = 1)<dd>If this option set to 2 then pixels are arranged within a byte such that pixelswith lower column values are stored in the lower-order bits of the byte; otherwisepixels are arranged in reverse order.</dl></blockquote> Earlier versions of Ghostscript always generated TIFF files with FillOrder = 2.According to the TIFF 6.0 specification, Section 8, page 32, support ofFillOrder = 2 is not required in a Baseline TIFF compliant reader <h3><a name="fax"></a>FAX</h3> <p>Ghostscript supports a variety of fax encodings, both encapsulated in <acronym>TIFF</acronym> (see above) and as raw files. The later case isdescribed here.</p> <p>The fax devices are <tt>faxg3</tt>, <tt>faxg32d</tt> and <tt>faxg4</tt>.</p> <h3><a name="BMP"></a>BMP</h3> <p>BMP is a simple uncompressed image format commonly used on MS Windows.It is supported by the devices <tt>bmpmono bmpgray bmpsep1   bmpsep8 bmp16 bmp256 bmp16m bmp32b</tt>.

Lines 1–500 of 1574.