⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 devices.htm

📁 GhostScript的源代码
💻 HTM
📖 第 1 页 / 共 5 页
字号:
	<td>for <b><tt>cdjmono</tt></b>
</table></blockquote>

<h2><a name="HP_paper_size"></a>Default paper size</h2>

<p>
If the preprocessor symbol <b><tt>A4</tt></b> is defined, the default paper
size is ISO A4; otherwise it is U.S. letter size (see about
<a href="Use.htm#Known_paper_sizes">paper sizes</a> in the usage
documentation).  You can <a href="Use#Paper_size">specify other paper
sizes</a> on the command line, including A3 for the PaintJet XL and
PaintJet XL300, as also explained in the usage documentation.

<h2><a name="HP_limits"></a>Deskjet physical limits</h2>

<p>
The Deskjet's maximum printing width is 2400 dots, or 8 inches
(20.32cm). The printer manuals say that the maximum recommended printing
height on the page is 10.3 inches (26.16cm), but since this is obviously
not true for A4 paper, and I have been unable to detect any problems in
printing longer page lengths, this would seem to be a rather artificial
restriction.

<p>
All Deskjets have 0.5 inches (1.27cm) of unprintable bottom margin, due to the mechanical
arrangement used to grab the paper.  Side margins are approximately 0.25 inches (0.64cm)
for U.S. letter paper, and 0.15 inches (0.38cm) for A4.

<h2><a name="HP_command_line"></a>Printer properties (command-line parameters)</h2>

<p>
Several printer "properties" have been implemented for these printers.
Those available so far are all integer quantities, and thus may be
specified, for instance, like

<blockquote>
<b><tt>gs -dBitsPerPixel=32 -dShingling=1</tt></b> ...
</blockquote>

<p>
which sets the <b><tt>BitsPerPixel</tt></b> parameter to 32 and the
<b><tt>Shingling</tt></b> parameter to 1.

<h3><a name="HP_bpp"></a>Bits per pixel</h3>

<p>
If the preprocessor symbol <b><tt>BITSPERPIXEL</tt></b> is defined as an
integer (see below for the range of allowable values), that number defines
the default bits per pixel (bit depth) for the generic drivers.  If the
symbol is undefined, the default is 24 bits per pixel.  It is, of course,
still possible to specify the value from the command line as described
below.  Note also that the <b><tt>cdeskjet</tt></b>,
<b><tt>cdjcolor</tt></b> and <b><tt>cdjmono</tt></b> drivers are unaffected
by setting this symbol, as their default settings are predefined to be 1, 3
and 24 respectively.

<p>
All of the drivers in <b><tt>gdevcdj.c</tt></b> accept a command line
option to set the <b><tt>BitsPerPixel</tt></b> property.  This gives
considerable flexibility in choosing various tradeoffs among speed,
quality, colour, etc.  The valid numbers are:

<blockquote><dl compact>
<dt><b>1</b>
<dd>A standard Ghostscript monochrome driver, using black ink (by
installing the separate mono cartridge in the case of the DeskJet 500C, or
automatically for the other printers).

<dt><b>3</b>
<dd>A standard Ghostscript colour driver, using internal dithering.  This
is fast to compute and to print, but the clustered dithering can lose some
detail and colour fidelity.

<dt><b>8</b>
<dd>An "error-diffusion" monochrome driver which uses Floyd-Steinberg
dithering to print greyscale images.  The patterns are much more randomised
than with the normal clustered dithering, but the data files can be much
larger and somewhat slower to print.

<dt><b>16</b>
<dd>A "cheaper" version of the 24-bit driver, which generates
Floyd-Steinberg colour dithered output using the minimum memory (this may
be helpful when using Ghostscript has not been compiled using a 16-bit
build environment).  The quality can be almost as good as the 24-bit
version.

<dt><b>24</b>
<dd>A high-quality colour driver using Floyd-Steinberg dithering for
maximum detail and colour range.  However, it is very memory-intensive, and
thus can be slow to compute.  It tends to produce rather larger raw data
files, so they can also take longer to print.

<dt><b>32</b>
<dd>Only for the DeskJet 550C, which uses the black cartridge and the
colour cartridge simultaneously (that is, CMYK printing). This printer can
both be faster and give higher quality than the DeskJet 500C, because of
the true black ink. (Note that the 24-bit mode also permits CMYK printing
on this printer, and uses less memory.  Any differences between 24-bit and
32-bit should be small.)
</dl></blockquote>

<h3><a name="HP_deskjet_properties"></a>Deskjet properties</h3>

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=bottom>
	<th align=left>Name
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<th align=left>Type
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<th align=left>&nbsp;
<tr>	<td colspan=5><hr>
<tr valign=top>	<td><b><tt>BlackCorrect</tt></b>
	<td>&nbsp;
	<td><b><tt>int</tt></b>
	<td>&nbsp;
	<td>Colour correction to give better blacks when using the DJ500C in colour mode.  For example, the default of 4 reduces the cyan component to 4/5. Range accepted: 0 - 9 (0 = none).
<tr valign=top>	<td><b><tt>Shingling</tt></b>
	<td>&nbsp;
	<td><b><tt>int</tt></b>
	<td>&nbsp;
	<td>Interlaced, multi-pass printing: 0 = none, 1 = 50%, 2 = 25%, 2 is best and slowest.
<tr valign=top>	<td><b><tt>Depletion</tt></b>
	<td>&nbsp;
	<td><b><tt>int</tt></b>
	<td>&nbsp;
	<td>"Intelligent" dot-removal: 0 = none, 1 = 25%, 2 = 50%, 1 best for graphics? Use 0 for transparencies.
</table></blockquote>

<h3><a name="HP_paintjet_properties"></a>Paintjet XL300 / Paintjet XL properties</h3>

<blockquote>
<table cellpadding=0 cellspacing=0>
<tr valign=bottom>
	<th align=left>Name
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<th align=left>Type
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<th align=left>
<tr>	<td colspan=5><hr>
<tr valign=top>	<td><b><tt>PrintQuality</tt></b>
	<td>&nbsp;
	<td><b><tt>int</tt></b>
	<td>&nbsp;
	<td>Mechanical print quality: -1 = fast, 0 = normal, 1 = presentation. Fast mode reduces ink usage and uses single-pass operation for some media types.  Presentation uses more ink and the maximum number of passes, giving slowest printing for highest quality
<tr valign=top>	<td><b><tt>RenderType</tt></b>
	<td>&nbsp;
	<td><b><tt>int</tt></b>
	<td>&nbsp;
	<td><dl compact>
		<dt><b>0</b><dd>driver does dithering
		<dt><b>1</b><dd>snap to primaries
		<dt><b>2</b><dd>snap black to white, others to black
		<dt><b>3</b><dd>ordered dither
		<dt><b>4</b><dd>error diffusion
		<dt><b>5</b><dd>monochrome ordered dither
		<dt><b>6</b><dd>monochrome error diffusion
		<dt><b>7</b><dd>cluster ordered dither
		<dt><b>8</b><dd>monochrome cluster ordered dither
		<dt><b>9</b><dd>user-defined dither (not supported)
		<dt><b>10</b><dd>monochrome user-defined dither ns.
		</dl>
</table>

<p>
The Paintjet (non-XL) has no additional properties.

</blockquote>

<h2><a name="HP_gamma"></a>Gamma correction</h2>

<p>
One consequence of using Floyd-Steinberg dithering rather than Ghostscript's
default clustered ordered dither is that it is much more obvious that the
ink dots are rather larger on the page than their nominal 1/180-inch or 1/300-inch
size (clustering the dots tends to minimise this effect).  Thus it is often
the case that the printed result is rather too dark.  A simple empirical
correction for this may be achieved by preceding the actual PostScript
file to be printed by a short file which effectively sets the gamma for
the device, such as

<blockquote><b><tt>
gs ... gamma.ps colorpic.ps -c quit
</tt></b></blockquote>

<p>
where <b><tt>gamma.ps</tt></b> is

<blockquote>
<pre>%!
/.fixtransfer {
  currentcolortransfer 4 {
    mark exch
    dup type dup /arraytype eq exch /packedarraytype eq or
    1 index xcheck and { /exec load } if
    0.333 /exp load
    ] cvx 4 1 roll
  } repeat setcolortransfer
} bind odef
.fixtransfer
/setpagedevice { setpagedevice .fixtransfer } bind odef</pre>
</blockquote>

<p>
This does the gamma correction <b><em>after</em></b> whatever correction
the device might be doing already.  To do the correction
<b><em>before</em></b> the current correction,

<blockquote>
<pre>%!
/.fixtransfer {
  currentcolortransfer 4 {
    mark 0.333 /exp load 4 -1 roll
    dup type dup /arraytype eq exch /packedarraytype eq or
    1 index xcheck and { /exec load } if
    ] cvx 4 1 roll
  } repeat setcolortransfer
} bind odef
.fixtransfer
/setpagedevice { setpagedevice .fixtransfer } bind odef</pre>
</blockquote>

<p>
This example sets the gamma for R, G, and B to 3, which seems to work
reasonably well in practice.

<h2><a name="HP_resolution_enhance"></a>HP's resolution-enhanced mode for Inkjet printers</h2>

<p>
This feature is available on HP's more recent inkjet printers, including
the Deskjet 520 (mono), 540 (mono or colour) and 560C (mono and colour).
The colour and monochrome drivers for the HP deskjet 550c are (probably)
the best you will get for use with Ghostscript, for the following reasons.

<p>
These printers do not offer true 600&times;300dpi resolution.  Those that
print in colour are strictly 300&times;300dpi in colour mode, while in mono
mode there is a pseudo 600&times;300dpi mode with the restriction that you
can't print two adjacent dots.  In effect what you have is 600dpi dot
positioning, but on average you don't get more dots per line.  This
provides the possibility, for instance, to have sharper character outlines,
because you can place dots on the edges nearer to their ideal positions.
This is why it is worth doing.

<p>
However, HP will not support user-level programming of this
resolution-enhanced mode, one reason being that (I understand) all the dot
spacing has to be done by the driver, and if you get it wrong, you can
actually damage the print head.

<p>
To summarise, you may lose a smidgin of (potential) text clarity using the
550c drivers (<b><tt>cdj550</tt></b>, <b><tt>cdjcolor</tt></b>,
<b><tt>cdjmono</tt></b> etc.), but other than that, they are the ones for
the job.

<h2><a name="HP_tips"></a>General tips</h2>

<p>
For all the printers above, the choice of paper is critically important to
the final results.  The printer manuals suggest type of paper, but in
general, smoother, less fibrous types give better results.  In particular,
the special ink-jet paper can make a big difference: colours are brighter,
but most importantly, there is almost no colour bleed, even with adjacent
areas of very heavy inking.  Similarly the special coated transparencies
also work well (and ordinary transparencies do not work at all!).

<p>
The Unix procedure <a href="Unix-lpr.htm"><b><tt>unix-lpr.sh</tt></b></a>
provides one example of setting up a multi-option colour PostScript
<b><tt>lpr</tt></b> queue on Unix systems, and includes the ability to
choose a range of different colour options and printer accounting and error
logging.

<p>
<b>Caveat emptor!</b> It is not always easy for me to test all of these
drivers, as the only colour printer I have here is the DeskJet 500C. I rely
on others to test drivers for the additional machines and report their
findings back to me.

<hr>

<h1><a name="BJC"></a>Canon BubbleJet (BJC) printers</h1>

<p>
This section was contributed by the author of the drivers, Yves Arrouye
&lt;<a href="mailto:yves.arrouye@usa.net">yves.arrouye@usa.net</a>&gt;.
The drivers handle Canon BJC-600, BJC-4xxx, BJC-70, Stylewriter 2x00, and
BJC-800 printers.

<h2><a name="BJC_history"></a>History</h2>

<p>
The BJC-600 driver was written in the first place by Yoshio Kuniyoshi and
later modified by Yves Arrouye
&lt;<a href="mailto:yves.arrouye@usa.net">yves.arrouye@usa.net</a>&gt;.  We
tried to make it evolve synchronously, though Yoshio cannot be reached
since a long time ago.  The drivers are based on code for the HP printers
by George Cameron (in fact, they are in the same file!), so he's the first
person to thank.

<p>
The 2.00 version of the drivers was a complete rewrite of the driver
(arguments, optimization, colour handling, in short: everything!) by Yves
Arrouye.  That release was also the first one to be able to use the full
width of an A3 paper size.  PostScript Printer Description (PPD) files for
the drivers were released with version 2.15.  They are incomplete,
but they can be used to drive the printers' main features.

<h2><a name="BJC_build"></a>Configuring and building the BJC drivers</h2>

<h3><a name="BJC_defaults"></a>Modify values in <b><tt>gdevbjc.h</tt></b></h3>

<p>
Configure the drivers by modifying the default values in the file
<b><tt>gdevbjc.h</tt></b> or on the compilation line.  If you don't do
that, the drivers use reasonable defaults that make them work "as
expected".  All default values shown here are defined in that file.

<h3><a name="BJC_CMYK_RGB"></a>CMYK-to-RGB color conversion</h3>

<p>
By default, the drivers use the same algorithm as Ghostscript to convert
CMYK colors to RGB. If you prefer to use Adobe formulas, define
<b><tt>USE_ADOBE_CMYK_RGB</tt></b> when compiling.  (See the top of the
file <b><tt>gdevcdj.c</tt></b> to see the difference between the two.)

<h3><a name="BJC_vertical_centering"></a>Vertical centering of the printable area</h3>

<p>
The drivers center the imageable area horizontally but not vertically, so
that what can be printed does use the most of the output media. If you
define <b><tt>BJC_DEFAULT_CENTEREDAREA</tt></b> when compiling, then the
top and bottom margins will be the same, resulting in a (smaller)
vertically centered imageable area also.

<h3><a name="BJC_margins"></a>Page margins</h3>

<p>
If you define <b><tt>USE_RECOMMENDED_MARGINS</tt></b>, then the top and
bottom margins will be the same (that is,
<b><tt>BJC_DEFAULT_CENTEREDAREA</tt></b> will be defined for you) and the
margins will be the 12.4mm recommended by Canon.  Since margins are
complicated (because one must rely on the mechanical precision of the
printer), the drivers do something about the bottom margin: by default the
bottom margin is 9.54mm for the BJC-600 driver and 7mm for the BJC-800.  If
you define <b><tt>USE_TIGHT_MARGINS</tt></b>, then the bottom margin is 7mm
for both drivers (but I never managed to get my own BJC-600 to print a line
on this low bound, hence the larger default).  Regardless of the presence

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -