Software: Apache/2.0.54 (Fedora). PHP/5.0.4 uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/doc/ghostscript-7.07/ drwxr-xr-x |
Viewing file: Select action/file-type: Details of Ghostscript output devicesTable of contents
For other information, see the Ghostscript overview. You may also be interested in how to build Ghostscript and install it, as well as the description of the driver interface. Notes on measurementsSeveral different important kinds of measures appear throughout this document: inches, centimeters and millimeters, points, and bits per pixel.
IJS - Inkjet and other raster devicesIJS is a relatively new initiative to improve the quality and ease of use of inkjet printing with Ghostscript. Using IJS, you can add new drivers or upgrade existing ones without recompiling Ghostscript. All driver authors are encouraged to adapt their drivers for IJS, and if there is an IJS driver available for your printer, it should be your first choice. The non-ijs raster printer drivers are deprecated and will be removed in future versions of ghostscript. Even more importantly, the vast majority of inkjet printers are now supported by one of the two free collections described below: Gimp-Print and HPIJS. Therefore the ijs interface is your best bet for such printers from a practical point of view as well. Please see the IJS web page for more information about IJS, including a listing of IJS-compatible drivers. A typical command line for IJS is: gs -DSAFER -sDEVICE=ijs -sIjsServer=hpijs -sDeviceManufacturer=HEWLETT-PACKARD -sDeviceModel='DESKJET 990' -DIjsUseOutputFD -sOutputFile=/dev/usb/lp1 -DNOPAUSE -- examples/tiger.eps Individual IJS command line parameters are as follows:
Generic Ghostscript options that are particularly relevant for IJS are summarized below:
Building IJSIJS is included by default on Unix gcc builds, and also in autoconf'ed builds. Others may need some makefile tweaking. First, make sure the IJS device is selected: DEVICE_DEVS2=$(DD)ijs.dev Next, make sure that the path and execution type are set in the toplevel makefile. The values for Unix are as follows: IJSSRCDIR=ijs IJSEXECTYPE=unix At present, "unix" and "win" are the only supported values for IJSEXECTYPE. If neither sounds appropriate for your system, it's possible that more porting work is needed. Last, make sure that ijs.mak is included in the toplevel makefile. It should be present right after the include of icclib.mak. IJS is not inherently platform-specific. We're very much interested in taking patches from people who have ported it to non-mainstream platforms. And once it's built, you won't have to recompile Ghostscript to support new drivers! Gimp-Print driversThe Gimp-Print driver collection supports a wide variety of inkjet printers and supports Ghostscript's 'ijs' interface. Just set the IjsServer parameter to 'ijsgimpprint'. Please see http://gimp-print.sourceforge.net/ for more information including supported printers and appropriate options. GNU Ghostscript also includes a special client device for the Gimp-Print family of drivers. The device itself is called stp for historical reasons. This device will not be supported in future versions of Ghostscript or Gimp-print. You will need to have the Gimp-Print library installed to use this device. The library distribution also includes extensive documentation on supported printers and the options available with each. Thanks to the Gimp-Print team for all their hard work integrating their excellent driver suite. Please note that the stp driver interface is only supported through gimp-print version 4.2. If you have 4.2.1 or later, please use the IJS interface (described above) instead. HP Inkjet official driversHP provides official drivers for many of their printer models. In order to use these drivers, you will need the HP Inkjet Server as well as Ghostscript, available from http://hpinkjet.sourceforge.net. This version of ghostscript also contains a special client driver 'hpijs' that predates the current ijs interface. It will not be supported in future versions of Ghostscript. Thanks to the folks at HP, especially David Suffield for making these drivers available and working to integrate it with Ghostscript. MS Windows printersThis section was written by Russell Lang, the author of Ghostscript's MS Windows-specific printer driver, and updated by Pierre Arnaud, the current maintainer. The mswinpr2 device uses MS Windows printer drivers, and thus should work with any printer with device-independent bitmap (DIB) raster capabilities. The printer resolution cannot be selected directly using PostScript commands from Ghostscript: use the printer setup in the Control Panel instead. It is however possible to specify a maximum resolution for the printed document (see below). If no Windows printer name is specified in -sOutputFile, Ghostscript prompts for a Windows printer using the standard Print Setup dialog box. You must set the orientation to Portrait and the page size to that expected by Ghostscript; otherwise the image will be clipped. Ghostscript sets the physical device size to that of the Windows printer driver, but it does not update the PostScript clipping path. If a Windows printer name is specified in -sOutputFile using the format "\\spool\printer_name", for instance gs ... -sOutputFile="\\spool\Apple LaserWriter II NT" then Ghostscript attempts to open the Windows printer without prompting (except, of course, if the printer is connected to FILE:). Ghostscript attempts to set the Windows printer page size and orientation to match that expected by Ghostscript, but doesn't always succeed. It uses this algorithm:
The Ghostscript physical device size is updated to match the Windows printer physical device. Supported command-line parametersThe mswinpr2 device supports a limited number of command-line parameters (e.g. it does not support setting the printer resolution). The recognized parameters are the following:
Supported options (device properties)Several extra options exist which cannot be set through the command-line, but only by executing the appropriate PostScript setup code. These options can be set through the inclusion of a setup file on the command-line: gs ... setup.ps ... The setup.ps file is responsible for the device selection, therefore you should not specify the -sDEVICE=mswinpr2 option on the command-line if you are using such a setup file. Here is an example of such a setup file: mark /NoCancel true % don't show the cancel dialog /BitsPerPixel 4 % force 4 bits/pixel /UserSettings << /DocumentName (Ghostscript document) % name for the Windows spooler /MaxResolution 360 % maximum document resolution >> (mswinpr2) finddevice % select the Windows device driver putdeviceprops setdevice This example disables the progress dialog (same as the -dNoCancel option), forces a 4 bits/pixel output resolution and specifies additional user settings, such as the document name (which will be displayed by the Windows spooler for the queued document) and the maximum resolution (here 360 dpi). It then finds and selects an instance of the MS Windows device printer and activates it. This will show the standard printer dialog, since no /OutputFile property was specified. The following options are available:
These properties can be queried through the currentpagedevice operator. The following PostScript code snippet shows how to do it for some of the properties: currentpagedevice /BitsPerPixel get == % displays the selected depth currentpagedevice /UserSettings get % get the additional options.. /us exch def % ..and assign them to a variable us /DocumentName get == % displays the document name us /SelectedRange get == % displays the selected page range % other misc. informations (don't rely on them) us /Color get == % 1 => monochrome output, 2 => color output us /PrintCopies get == % displays the number of copies requested There are a few undocumented informations stored in the UserSettings dictionary. You should not rely on them. Their use is still experimental and they could be removed in a future version. Duplex printingIf the Windows printer supports the duplex printing feature, then it will also be available through the mswinpr2 device. You can query for this support through the /Duplex propery of the currentpagedevice. If it returns null, then the feature is not supported by the selected printer. Otherwise, true means that the printer is currently set up to print on both faces of the paper and false that it is not, but that it can. The following example shows how to print on both faces of the paper (using the long side of the paper as the reference): << /Duplex true /Tumble false >> setpagedevice
File formatsJPEG file format (JFIF)Ghostscript includes output drivers that can produce Independent JPEG Group JFIF (JPEG File Interchange Format) files from PostScript images. Please note that JPEG is a compression method specifically intended for continuous-tone images such as photographs, not for graphics, and it is therefore quite unsuitable for the vast majority of page images produced with PostScript, which should be saved in a form better for graphics, such as Portable Network Graphics (PNG) format. If you get crummy-looking JPEG files, don't blame Ghostscript; instead consult a reference about uses and abuses of JPEG, such as the JPEG FAQ http://www.faqs.org/faqs/jpeg-faq/ You can use the JPEG output drivers -- jpeg to produce color JPEG files and jpeggray for grayscale JPEGs -- the same as other file-format drivers: by specifying the device name and an output file name, for example gs -sDEVICE=jpeg -sOutputFile=foo.jpg foo.ps You can also use the -r switch to specify the imaging resolution and thus the output file's size in pixels. The default resolution is normally 72×72dpi. The JPEG devices support several special parameters to control the JPEG "quality setting" (DCT quantization level).
At this writing the default JPEG quality level of 75 is equivalent to -dQFactor=0.5, but the JPEG default might change in the future. The JPEG drivers could be extended to support additional JPEG compression options, such as the other DCTEncode filter parameters, but so far they haven't been. TIFF file formatsThere are two unrelated sets of TIFF drivers. There are two color TIFF drivers that produce uncompressed output:
The remaining TIFF drivers all produce black-and-white output with different compression modes:
The black-and-white TIFF drivers support creation of files that are comprised of more than a single strip. Multi-strip files reduce the memory requirement on the reader, since readers need only store and process one strip at a time. These drivers provide two parameters beyond the standard set:
The TIFF 6.0 specification, Section 7, page 27, recommends that the size of each strip be about 8 Kbytes. As an example, to generate the 'tiger' in tiffg4 format that has the recommended strip size, use: gs -sDEVICE=tiffg4 -sOutputFile=tiger.tif -dMaxStripSize=8192 examples/tiger.ps If the value of the MaxStripSize parameter is smaller than a single image row, then no error will be generated, and the TIFF file will be generated correctly using one row per strip. Note that smaller strip sizes increase the size of the file by increasing the size of the StripOffsets and StripByteCounts tables, and by reducing the effectiveness of the compression which must start over for each strip. If the value of MaxStripSize is 0 (the default), then the entire image will be a single strip. Display DevicesGhostscript is often used for screen display of postscript and pdf documents. In many cases, a client or 'viewer' application calls the ghostscript engine to do the rasterization and handles the display of the resulting image itself, but it is also possible to invoke ghostscript directly and select an output device which directly handles displaying the image on screen. This section describes the various display-oriented devices that are available in ghostscript. X Window SystemPerhaps the most common use of of a display device is with the X Window System on unix-like systems. It is the default device on the command line client on such systems, and is used more creatively by the gv client application. The available devices are:
H-P color inkjet printersThis section, written by George Cameron, deals with the DeskJet 500C, DeskJet 550C, PaintJet, PaintJet XL, PaintJet XL300, the DEC LJ250 operating in PaintJet-compatible mode. Drivers contained in gdevcdj.cThe source module gdevcdj.c contains six generic drivers:
All these drivers have 8-bit (monochrome), 16-bit and 24-bit (colour) and for the DJ 550C, 32-bit (colour, CMYK mode) options in addition to standard colour and mono drivers. It is also possible to set various printer-specific parameters from the command line, for example gs -sDEVICE=cDeskJet -dBitsPerPixel=16 -dDepletion=1 -dShingling=2 tiger.ps Note: the old names cDeskJet, cdjcolor and cdjmono drivers have been retained; however, their functionality duplicates that available using the drivers above (and cDeskJet is identical to cdj500). That is, we can use
Default paper sizeIf the preprocessor symbol A4 is defined, the default paper size is ISO A4; otherwise it is U.S. letter size (see about paper sizes in the usage documentation). You can specify other paper sizes on the command line, including A3 for the PaintJet XL and PaintJet XL300, as also explained in the usage documentation. DeskJet physical limitsThe 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. 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. Printer properties (command-line parameters)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 gs -dBitsPerPixel=32 -dShingling=1 ... which sets the BitsPerPixel parameter to 32 and the Shingling parameter to 1. Bits per pixelIf the preprocessor symbol BITSPERPIXEL 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 cDeskJet, cdjcolor and cdjmono drivers are unaffected by setting this symbol, as their default settings are predefined to be 1, 3 and 24 respectively. All of the drivers in gdevcdj.c accept a command line option to set the BitsPerPixel property. This gives considerable flexibility in choosing various tradeoffs among speed, quality, colour, etc. The valid numbers are:
DeskJet properties
PaintJet XL300 / PaintJet XL properties
Gamma correctionOne 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 gs ... gamma.ps colorpic.ps -c quit where gamma.ps is %! /.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 This does the gamma correction after whatever correction the device might be doing already. To do the correction before the current correction, %! /.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 This example sets the gamma for R, G, and B to 3, which seems to work reasonably well in practice. HP's resolution-enhanced mode for Inkjet printersThis 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. These printers do not offer true 600×300dpi resolution. Those that print in colour are strictly 300×300dpi in colour mode, while in mono mode there is a pseudo 600×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. 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. To summarise, you may lose a smidgin of (potential) text clarity using the 550c drivers (cdj550, cdjcolor, cdjmono etc.), but other than that, they are the ones for the job. General tipsFor 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!). The Unix procedure unix-lpr.sh provides one example of setting up a multi-option colour PostScript lpr queue on Unix systems, and includes the ability to choose a range of different colour options and printer accounting and error logging. Caveat emptor! 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. Canon BJC-8200 printerThis section was contributed by the author of the uniprint configuration files for the Canon BJC-8200, Stephan C. Buchert <scb@stelab.nagoya-u.ac.jp>. These files also handle the Japanese Canon F850 printer. Warning: Usage of this program is neither supported nor endorsed by the Canon corporation. Please see the Ghostscript license regarding warranty. IntroductionThe Canon Bubble Jet printer BJC-8200 is designed for printing digital photos and halftone images. Software drivers for Windows 95-2000 and Mac are usually included and can be downloaded from the Canon web sites like http://consumer.usa.canon.com/bjc/bjc8200/ for the US market. If these drivers cannot be used for some reason, then at present Ghostscript is probably the alternative giving the best results. The BJC-8200 has features not found among the specs of earlier bubble jet models (except the even more advanced BJC-8500) and is advertised to offer:
Access to features 5 and 6 requires use of the original Canon drivers for the foreseeable future. This README is about getting the printer features 1-3 working with Ghostscript. No (re)compilation of Ghostscript is normally required. Ghostscript comes with a relatively highly configurable driver, called uniprint, for printers which understand raster images in various propriety formats. Most options for this driver are usually organized into files having the suffix ".upp." Ghostscript versions >= 5.10 (or even earlier) include such uniprint control files for the Canon BJC-610. They work also well for some other Canon Bubble Jet models, for example for my BJC-35vII. But when using them for a BJC-8200 the result is unsatisfactory. The uniprint control files for the BJC-8200After some experimenting with the options for uniprint I have obtained quite satisfactory prints with my printer(*). This distribution includes six new uniprint control files:
They are included in Ghostscript >=6.21. For older versions you can put them anywhere in the Ghostscript search path (type "gs -h" to see the path), but should perhaps add the files to the directory with the other *.upp files. This is "/usr/share/ghostscript/gs6.01/lib" in my RedHat Linux 6.1 box with Aladdin Ghostscript 6.01. Here is an explanation of my file name convention: the prefix "bj8" should perhaps be used for the Canon BJC-8200 and compatible (like the Japanese F850 and perhaps the non-Japanese BJC-8500) models. The next two letters indicate the print media:
The numbers at positions 6 and 7 indicate the resolution
The last letter stands for a quality factor that effects also the print speed (presumably related to the number of passes that the printhead makes).
Printing a postcard size (~10x15 cm^2) image at 1200x1200 DpI^2 takes about 3 minutes. The output of Ghostscript is then typically 4-5 MByte. The bootleneck seems to be the transfer of the raster image in run-length encoded Canon format to the printer (via the parallel port on my system) or the printer's speed, not Ghostscript or the uniprint renderer. Further Optimization for the Canon BJC-8200So far I have only experimented with the printer initialization code at the beginning of each page (-dupBeginPageCommand) and the resolution (-r). Other options, particularly the transfer arrays (-dupBlackTransfer, -dupCyanTransfer, -dupMagentaTransfer, -dupYellowTransfer) and the margins (-dupMargins) were simply copied from the files for the BJC-610, but they may need to be changed for optimized performance.Here is information useful for changing or adding uniprint control files for the BJC-8200: In "-dupBeginPageCommand=..." use the line 1b28 64 0400 04b0 04b0 for 1200x1200 resolution, and 1b28 64 0400 0258 0258 for 600x600. The "-r" option in the control file must of course match this line. Other resolutions might work as well, but I didn't try. Crucial are the numbers in the lines like 1b28 63 0300 3005 04 ^ ^ Plain Paper 0 4 Highest quality OHP transparency 2 . T-shirt transfer 3 . Glossy Photo Film 5 . High Gloss Paper 6 0 Lowest quality Photo Paper Pro 9 OutlookPresently uniprint can use the black (K), cyan (C), magenta (M), and yellow (Y) colors in the BJC-8200. The unused colors are photo (or light) cyan (c) and magenta (m). Also the Canon driver seems to use only CMYK, for example when printing on Photo Paper Pro in "Camera" or "SuperPhoto" mode. These modes supposedly produce prints of the best quality that the Canon driver can offer. Other modes of Canon driver do use up to all six color cartridges (CMYKcm). Therefore expanding uniprint's capabilities for six colors would be interesting, but it may not increase the output quality of 6-color printers such as the BJC-8200 drastically. More control files for uniprint could be added in order to offer more versatility for controlling the BJC-8200 within a Ghostscript installation. The number of possible combinations for media type, resolution and print quality factor is very large, many combinations would not make much sense, many might be used here and there, but relatively rarely. The user would have to remember a name for each combination that is used. A better way would be to let the user patch optionally a user owned or system wide uniprint control file before each print via some print tool. This is similar to the approach taken by Canon with their driver for Windows. Similarly a uniprint tool could also incorporate other functions such as printing test and demo pages and the low ink warning once the protocol for this is known. Clearly it would be difficult to code such a uniprint tool for all the platforms where Ghostscript is running. Usage on RedHat LinuxIn order to install a BJC-8200 printer on a RedHat Linux system with RedHat's printtool, you need also to insert with a text editor the contents of the file bj8.rpd into the RedHat printer database /usr/lib/rhs/rhs-printfilters/printerdb. Insert it most appropriately after the section StartEntry: U_CanonBJC610 . . . EndEntry < --- insert here "bj8.rpd" from this distribution: < --- StartEntry: U_CanonBJC8200 . . . Contacting the AuthorE-mail address: <scb@stelab.nagoya-u.ac.jp> Footnotes: (*) Actually I have a F850, not a BJC-8200. That model is sold for the Japanese market only. The specs and also the external look are the same as those of the BJC-8200 models for the American and European markets. I expect that the raster image mode which is used exclusively by Ghostscript is entirely compatible for both models. Stephan C. Buchert Other Canon BubbleJet (BJC) printersThis section was contributed by the author of the drivers, Yves Arrouye (<yves.arrouye@usa.net>, but please do not send questions to him: he no longer maintains these drivers.) The drivers handle Canon BJC-600, BJC-4xxx, BJC-70, Stylewriter 2x00, and BJC-800 printers. HistoryThe BJC-600 driver was written in the first place by Yoshio Kuniyoshi and later modified by Yves Arrouye. 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. 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. Configuring and building the BJC driversModify values in gdevbjc.hConfigure the drivers by modifying the default values in the file gdevbjc.h 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. CMYK-to-RGB color conversionBy default, the drivers use the same algorithm as Ghostscript to convert CMYK colors to RGB. If you prefer to use Adobe formulas, define USE_ADOBE_CMYK_RGB when compiling. (See the top of the file gdevcdj.c to see the difference between the two.) Vertical centering of the printable areaThe 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 BJC_DEFAULT_CENTEREDAREA when compiling, then the top and bottom margins will be the same, resulting in a (smaller) vertically centered imageable area also. Page marginsIf you define USE_RECOMMENDED_MARGINS, then the top and bottom margins will be the same (that is, BJC_DEFAULT_CENTEREDAREA 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 USE_TIGHT_MARGINS, 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 of this definition, USE_FIXED_MARGINS will not allow the BJC-800 to use the lower 7mm bottom margin, so if you have a problem with the bottom margin on a BJC-800, just define that (without defining USE_TIGHT_MARGINS, of course). A quick way to be sure the margins you selected is to print a file whose contents are: %! If the margins are okay, you will get a rectangle visibly surrounding the printable area. If they're not correct, one or more of the sides will be either incomplete or completely unprinted. Makefile and compilationMake sure the bjc600 or bjc800 devices are in DEVICE_DEVS in the makefile; that is, look in the makefile for your platform and add them if necessary -- they may already be there. As of Ghostscript 5.10, for instance, one makefile has DEVICE_DEVS6=bj10e.dev bj200.dev bjc600.dev bjc800.dev Use of the driversThere are two drivers here. The "bjc600" one supports the BJC-600 and BJC-4xxx (maybe the BJC-70 as well) and the "bjc800" one supports the BJC-800 series. Remarks here that apply to both drivers use the name "bjc". Supported Options and DefaultsNote: "options", "properties", and "parameters" designate the same thing: device parameters that you can change. Giving an option an incorrect value causes an error. Unless stated otherwise, this error will be a rangecheckerror. Options may be set from the Ghostscript command line (using the -d and -s switches or other predetermined switches if they have an effect on the driver) or using the PostScript Level 2 setpagedevice operator if Ghostscript has been compiled with the level2 or level3 device (which it should ;-)). There are no special-purpose operators such as one was able to find in Level 1 printers. The bjc uses 24 bits per pixel by default (unless you change the value of BJC_BITSPERPIXEL), corresponding to CMYK printing. Supported modes are 1 bpp and 4 bpp (gray levels), 8 bpp, 16 bpp, 24 bpp and 32 bpp (colours). Colours are preferably stored in the CMYK model (which means, for example, that with 16 bpp there are only 16 different shades of each color) but it is possible to store them as RGB color for some depths. Some modes do Floyd-Steinberg dithering and some don't, but use the default Ghostscript halftoning (in fact, when halftoning is used, dithering takes also place but because of the low point density it is usually not efficient, and thus invisible).
These modes are selected using the BitsPerPixel and Colors integer options (either from the command line or in a PostScript program using setpagedevice). See below. A note about darkness of what is printed: Canon printers do print dark, really. And the Floyd-Steinberg dithering may eventually darken your image too. So you may need to apply gamma correction by calling Ghostscript as in gs -sDEVICE=bjc600 gamma.ps myfile.ps where gamma.ps changes the gamma correction (here to 3 for all colors); 0.45 gives me good results, but your mileage may vary. The bigger the value the lighter the output: { 0.45 exp } dup dup currenttransfer setcolortransfer The drivers support printing at 90dpi, 180dpi and 360dpi. Horizontal and vertical resolutions must be the same or a limitcheck error will happen. A rangecheck will happen too if the resolution is not 90 ×2^N. If the driver is compiled with -DBJC_STRICT a rangecheck also happens if the resolution is not one of those supported. This is not the case, as we expect that there may be a 720dpi bjc some day. Here are the various options supported by the bjc drivers, along with their types, supported values, effects, and usage:
Note that the MediaType and ThickMedia options will be replaced by the use of the device InputAttributes and OutputAttributes as soon as possible. Please note too that the print mode may be reset at the start of printing, not at the end. This is the expected behaviour. If you need to reset the printer to its default state, simply print a file that does just a showpage. Device informationHere is other information published by the driver that you will find in the deviceinfo dictionary.
Hardware marginsThe BJC printers have top and bottom hardware margins of 3mm and 7.1mm respectively (Canon says 7mm, but this is unusable because of the rounding of paper sizes to PostScript points). The left margin is 3.4mm for A4 and smaller paper sizes, 6.4mm for U.S. paper sizes, envelopes and cards. It is 4.0mm for A3 paper on the BJC-800. The maximum printing width of a BJC-600 printer is 203mm. The maximum printing width of a BJC-800 printer is 289mm on A3 paper, 203mm on U.S. letter and ISO A4 paper. PostScript printer description (PPD) filesThe files CBJC600.PPD and CBJC800.PPD (whose long names are, respectively, Canon_BubbleJetColor_600.ppd and Canon_BubbleJetColor_800.ppd) are PPD files to drive the features of the bjc600 and bjc800 drivers. They can be used, for example, on NextStep systems (presumably on OpenStep systems too) and on Unix systems with Adobe's TranScript and pslpr (not tested). The files are not complete at the moment. Please note that NextStep's printing interface does not correctly enforce constraints specified in these files (in UIConstraints descriptions): you must force yourself to use valid combinations of options. Customizing the PPD filesBy default the PPD files are set for U.S. letter size paper, and they use a normalized transfer function. If you choose to use A4 printing by default, you must replace "Letter" with "A4" in these (noncontiguous) lines: [...] Some versions of Ghostscript have problems with normalized colors, which makes them add magenta in gray levels. If you experience this problem, in the PPD file replace the line *DefaultTransfer: Normalized with the alternate line *DefaultTransfer: Null The "thick media" option is implemented by choosing a value of 120 or 80 (for thick and thin media respectively) for the MediaWeight feature of the drivers. If you ever change the threshold for thick media in the driver code, you may need to change the values in the PPD files too. All customization should be done using the "*Include:" feature of PPD files so that your local changes will be retained if you update the PPD files. How to report problemsYves Arrouye no longer maintains this driver, and will not answer questions about it. If you are posting a question about it in a public form, please be as descriptive as possible, and please send information that can be used to reproduce the problem. Don't forget to say which driver you use, and in what version. Version information can be found in the source code of the driver or by issuing the following command in a shell: echo "currentpagedevice /VersionString get ==" | gs -q -sDEVICE=bjc600 - AcknowledgementsI am particularly grateful to Yoshio Kuniyoshi <yoshio@nak.math.keio.ac.jp> without whom I'd never make these drivers, and also to L. Peter Deutsch, who answered all my (often silly) questions about Ghostscript's driver interface. Thanks also to the people who volunteered to beta-test the v2.x BJC drivers: David Gaudine <david@donald.concordia.ca>, Robert M. Kenney <rmk@unh.edu>, James McPherson <someone@erols.com> and Ian Thurlbeck <ian@stams.strath.ac.uk> (listed alphabetically) were particularly helpful by discovering bugs and helping find out exact paper margins on printers I don't have access to. And many thanks to Klaus-Gunther Hess <ghess@elmos.de> for looking at the dithering code and devising a good CMYK dithering algorithm for the Epson Stylus Color, which I then adapted to the code of these drivers. Epson Stylus color printer (see also uniprint)This section was contributed by Gunther Hess <ghess@elmos.de>, who also wrote uniprint, a later set of drivers. You should probably see the section on uniprint for whether it might be better for your uses than this driver. UsageThis driver is selected with "-sDEVICE=stcolor", producing output for an Epson Stylus Color at 360dpi resolution by default. But it can do much more with this printer, and with significantly better quality, than with the default mode; and it can also produce code for monochrome versions of the printer. This can be achieved via either command-line options or Ghostscript input. For convenience a PostScript file is supplied for use as an initial input file. Try the following command: gs -sDEVICE=stcolor -r{Xdpi}x{Ydpi} stcolor.ps {YourFile.ps} where {Xdpi} is one of 180, 360, or 720 and {Ydpi} is one of 90, 180, 360, or 720. The result should be significantly better. You may use stcolor.ps with other devices too, but I do not recommend this, since it does nothing then. stcolor.ps should be available with binary distributions and should reside in the same directory as other Ghostscript initialization files or in the same directory as the files to be printed. Thus if Ghostscript is part of your printer-spooler, you can insert (stcolor.ps) findlibfile { pop run } if pop in files you want to use the improved algorithms. You may want to adapt stcolor.ps file to your specific needs. The methods and options for this are described here, but this description is restricted to Ghostscript options, while their manipulation at the PostScript level is documented in the material on the relationship of Ghostscript and PostScript and in stcolor.ps. OptionsNow to explain the options (as written on my UNIX system). The order is somehow related to their use during the printing process:
ESC/P2 allows any resolutions to be valid in theory, but only -r360x360 (the default) and -r720x720 (not on STC-IIs ? and st800) are known to work with most printers.
Beware: there are only few validity checks for parameters. A good example is escp_Band: if you set this, the driver uses your value even if the value is not supported by the printer. You asked for it and you got it! Application note and FAQQuite a bunch of parameters. Hopefully you never need any of them, besides feeding stcolor.ps to Ghostscript in front of your input. After answering some questions over fifty times I prepared a FAQ. Here is version 1.3 of the FAQ, as of stcolor version 1.20 (for Ghostscript 3.50). Support for A3 paperYes, this driver supports the A3-size printer: merely set the required pagesize and margins. A simple way to do this is to specify the command-line switch "-sPAPERSIZE=a3" or include the procedure call "a3" in the PostScript prolog section. To optimize the printable area or set the proper margins, see the next paragraph. Margins, PageSizeI refuse to add code to stcolor that tries to guess the proper margins or page size, because I found that such guessing is usually wrong and needs correction in either the source or the parameters. You can modify stcolor.ps to do that, however. After the line mark % prepare stack for "putdeviceprops" insert these lines, which define page size and margins in points: /.HWMargins [9.0 39.96 12.6 9.0] % Left, bottom, right, top (1/72") /PageSize [597.6 842.4] % Paper, including margins (1/72") /Margins [ % neg. Offset to Left/Top in Pixels 4 index 0 get STCold /HWResolution get 0 get mul 72 div neg 5 index 3 get STCold /HWResolution get 1 get mul 72 div neg ] Feel free to change the values of .HWMargins and PageSize to match your needs; the values given are the defaults when the driver is compiled with "-DA4". This option or its omission may cause trouble: the Stylus Color can print up to exactly 8 inches (2880 pixels) at 360dpi. The remaining paper is the margin, where the left margin varies only slightly with the paper size, while the right margin is significantly increased for wider paper, such as U.S. letter size. Note that if you are using an ISO paper size with a version of stcolor after 1.20 and compiled without "-DA4", then the default margin is too large, and you need to add the proper ".HWMargins" to the command line or to stcolor.ps. Stylus Color II / IIs and 1500First the good news: the driver can print on the Stylus Color II. Now the bad news:
To make things work, you MUST disable the driver's internal weaving (Softweave), in one of these two ways: gs -dMicroweave ... Version 1.90, current as of Ghostscript 5.10, fixes this bug by new default behaviour. I experienced significantly increased printing speed with the second variant on the old Stylus Color, when printing mostly monochrome data. RecommendationsThe next section is a contribution from Jason Patterson <jason@reflections.com.au> who evaluated a previous version (1.17). Ghostscript was invoked as follows:
where "..." is the name of the desired algorithm. stcolor.ps was omitted for the gs-algorithms (gsmono, gsrgb and gscmyk), for which it is useless and would not allow the selection of "gscmyk". Color dithering experiments with gdevstc 1.21Here are data about the EPSON Stylus Color driver's different dithering methods, based on a little experiment using four good quality scanned images of quite varied nature, to begin with, a summary of the results of the four experiments. Sanity note: the results here are from only four images and a total of 24 printouts (eight on 720dpi paper, sixteen on plain paper). Your results will almost certainly vary, and your standards might not be the same as mine, so use these results only as a guide, not as a formal evaluation.
Color transformationIn the initial version of the driver distributed with Ghostscript 3.33, the parameter "SpotSize" was the only way to manipulate the colors at the driver level. According to the parameters enumerated above, this has changed significantly with version 1.16 and above as a result an ongoing discussion about dithering algorithms and "false color" on the Epson Stylus Color. This initiated the transformation of the stcolor driver into a framework for different dithering algorithms, providing a generalized interface to the internal Ghostscript color models and the other data structures related to Ghostscript drivers. The main thing such a framework should be able to do is to deliver the values the dithering algorithm needs; and since this directly influences the optical image impression, this transformation should be adjustable without the need for recompilation and relinking. In general the process can be described as follows:
Due to the limitations on raster storage, information is lost in the first transformation step, except for the 16-bit monochrome mode. So any color adjustment should take place before this step and this is where the optional ColorAdjustMatrix works. The first transformation step, called "coding", is controlled by the ?coding arrays. The decoding process expands the range of values expontentially to a larger range than that provided by the initial Ghostscript color model, and is therefore a reasonable place to make device- or algorithm-specific adjustments. This is where the ?transfer arrays are used. Array access might be not the fastest method, but its generality is superior, so this step is always based upon internally algorithm-specific array access. If 8 bits are stored per color component and if the algorithm uses bytes too, the second transformation is included within the first, which saves significant computation time when printing the data. ColorAdjustMatrixThe driver supports different values for ProcessColorModel, which raises the need for different color adjustments. Here "CAM" stands for "ColorAdjustMatrix".
If no ColorAdjustMatrix is set, the matrix computations are skipped. Thus the transformation reduces to range inversion in monochrome mode and black separation in CMYK mode. RGB / CMYK coding and transfer, and BitsPerPixelThese two (groups of) parameters are arrays of floating-point numbers in the range 0.0 to 1.0. They control the truncation to the desired number of bits stored in raster memory (BitsPerPixel) and the ink density. The "truncation" may become a nonlinear function if any of the ?coding arrays is set. Assume the following Ghostscript invocation: gs -sDEVICE=stcolor -sDithering=fscmyk -dBitsPerPixel=16 \ -dKcoding='{ 0.0 0.09 0.9 1.0 }' \ -dMcoding='{ 0.0 0.09 0.9 1.0 }' \ -dKtransfer='{ 0.0 0.09 0.9 1.0 }' \ -dYtransfer='{ 0.0 0.09 0.9 1.0 }' We may have either or both of ?coding and ?transfer, giving four possible combinations. (These four combinations appear in the given example.) The resulting mapping appears in the following tables, where except for the internal Indices (4 components × 4 bits = 16 BitsPerPixel), all values are normalized to the range 0 to 1. The actual range is 0 to 65535 for the Ghostscript color and 0 to 16777215 for the ink values delivered to the fscmyk algorithm. Sorry for the bunch of numbers following, but you may try this example in conjunction with stcinfo.ps, which should give you a graphical printout of the following numbers when you issue a showpage command.
The difference between cyan and magenta is the presence of a coding array. The coding process must map a range of color values to each of the sixteen component indices. If no coding array is given, this is accomplished by dividing by 4096, equivalent to a right shift by 12 bits. The final ink density resides in the given interval and moves from the left to the right side from 0 to 15. For magenta there is a coding array and the ink value matches the center of the intervals. But the distribution of the mapped intervals follows the given coding array and is nonlinear in the linear color space of Ghostscript. Now let us take a look at the case with transfer arrays:
Yellow uses a transfer array. There is no linear correspondence between the color and the ink values: this correspondence is defined through the given array. In other words, the transfer arrays define a nonlinear ink characteristic, which is exactly the same functionality that PostScript's "(color)transfer" function provides. While for yellow the intervals match the intervals used with cyan, for black the intervals match the magenta intervals. But watch the correspondence between the CI/15 values and the ink density for black: this is a linear distribution in the ink domain. Not a bad idea, I think. Consider the fs2 algorithm: it uses values in the range 0 to 255. If any transfer array were alone, some of the 256 possible values would never be used and others would be used for adjacent intervals several times. Establishing an identical coding array solves this problem, so the full potential of the algorithm is used. Another useful feature of the coding arrays is that they are internally normalized to the range 0-1. In 720x720dpi mode the transfer arrays in stcolor.ps limit the dot density to about 50%, so these arrays end at 0.5 (and begin at 0.5 for RGB). Because of automatic normalization, these arrays can also be used as coding arrays. But of course in the fs2 case mentioned above, values from 0 to 127 will never be delivered to the algorithm, while values 128-255 are delivered for adjacent intervals. To clarify the intended use of the three parameters (parameter groups), keep this in mind:
What is weaving?The Epson Stylus Color has a head assembly that contains two physically identifiable heads, one for black and one for cyan, magenta, and yellow (CMY). This makes four "logical" heads, one for each color component. Each of these four heads has several jets at some vertical (Y) distance from one another, so several horizontal lines can be printed of a given color during one pass of the heads. From experience I think there are fifteen jets per color, spaced at 1/90in. So the question arises of how to print at a Y resolution of 360dpi with 90dpi jets. Simply by division one gets 360dpi/90dpi = 4, which tells us that 4 passes of the head assembly are needed to achieve a Y resolution of 360dpi. Weaving is the method of how the fifteen jets are used to print adjacent horizontal rows separated here by 1/360 inch:
Now let's assume that the dot diameter is different for each individual jet, but the average among the jets matches the desired resolution. With weaving, adjacent rows are printed by different jets, thus some averaging takes place. Without weaving, adjacent rows are printed by the same jet and this makes the dot diameter deviations visible as 1/90in stripes on the paper. Print mode parametersThe parameters "Unidirectional", "Microweave", "noWeave", "OutputCode", "Model" and the given resolution control the data generated for the printer. UnidirectionalSimply toggles the unidirectional mode of the printer. Setting "Unidirectional" definitely slows printing speed, but may improve the quality. I use this for printing transparencies, where fast head movement could smear the ink. Microweave, noWeave and OutputCode=deltarowThe first are two booleans, which implies that four combinations are possible. Actually only three exist (if you don't count for deltarow): Softweave, Microweave, and noWeave. The first and second are functionally identical, the difference being whether the driver or the printer does the job. In the default Softweave mode the driver sends the data properly arranged to the printer, while in Microweave mode, it is the printer that arranges the data. But in general the host processor is much faster than the printer's processor, and thus it is faster for the host do the job. In addition to that, for 720dpi eight passes are required, and the amount of buffer space needed to buffer the data for the passes is far beyond the printer's memory. Softweave requires an odd value of "escp_Band"; the Stylus Color provides fifteen for that. "OutputCode" controls the encoding used. In the basic modes, the choice consists of "plain" and "runlength". The computation of runlength-encoded data does not take much time, less than the data tranfer to the printer; thus this is the recommended mode, and of course the default. With the Stylus Color, Epson introduced some new encoding principles, namely "tiff" and "deltarow". While the first was omitted from this driver for lack of apparent advantages, "deltarow" is available as an option. "Softweave" cannot be used with this encoding, so if OutputCode=deltarow is set, Microweave becomes the default. Maybe that the size of the ESC/P2 code becomes smaller, but I have never observed faster printing speed. Things tend to become slower with deltarow compared to Softweave. ModelSome ESC/P2 printers such as the Stylus 800 do not offer Microweave or the commands required to do Softweave. Setting Model just changes the defaults and omits some parts of the initialization sequence which are not compatible with the given printer model. Currently only "st800" is supported besides the default stcolor. Bugs and pitfalls
TestsThis section gives an overview of performance in terms of processing and printing times, from tests run after version 1.13. Printing was done offline (simply copying a processed file to the printer) to measure real printing speed without regard to speed of processing on the host, since at high resolutions, processing time is the same order of magnitude and thus may become the limiting factor. The various OutputCodesI ran several files though Ghostscript and recorded the size of the resulting print code, the processing time, and the printing time, at least for some of the files, always using these options: gs -sDEVICE=stcolor -sPAPERSIZE=a4 stcolor.ps - < file.ps (Actually "-sPAPERSIZE=a4" is in my gs_init.ps since I'm a germ.) "deltarow" is the new encoding principle ("ESC . 3 10 10 1") with Microweave on. It is activated with "-sOutputCode=deltarow". "Softweave" actually means that nothing else was used: it is the default, and implies that odd v=40/h=10/m=15 mode ("ESC . 1 40 10 15"). "Microweave" means "-dMicroweave", equivalent to "ESC . 1 10 10 1", with full skip optimization and microweave activated. Finally I wanted to see the plain Kathy Ireland, and used "-sOutputCode=plain", which just replaces runlength encoding (RLE) by no encoding, thus using "ESC . 0 40 10 15". [So sorry ;-) Kathy was still dressed in blue in front of the blue sea on a blue air cushion -- nice to see but hard to dither.] So here are the results.
It may be that I've not chosen the optimal deltarow code, but even if it saves at lot of bytes, printing-speed is not increased. At least the printer prefers plain Kathy. In other words, sending 1 Megabyte or 20% more data has no impact on printing speed. drawing.ps is an exception to this rule: plain prints slower than RLE. "Unclever" coding -- especially with deltarow -- can significantly slow down printing. But even if very significant advantages in the size of the code are achieved, "deltarow" is not competitive. colorcir.ps shows savings with deltarow, but printing is a mess. Printing time related to other optionsFull page halftone images printed, unless otherwise noted.
AcknowledgmentsThis driver was copied from gdevcdj.c (Ghostscript 3.12), which was contributed by George Cameron, Koert Zeilstra, and Eckhard Rueggeberg. Some of the ESC/P2 code was drawn from Richard Brown's gdevescp.c. The POSIX interrupt code (compilation option -DSTC_SIGNAL) is from Frederic Loyer. Several improvements are based on discussions with Brian Converse, Bill Davidson, Gero Guenther, Jason Patterson, ? Rueschstroer, and Steven Singer. While I wish to thank everyone mentioned above, they are by no means responsible for bugs in the stcolor driver -- just for the features. Gunther HessRichard Wagner Strasse 112 D-47057 Duisburg Germany +49 203 376273 telephone (MET evening hours) <ghess@elmos.de> uniprint, a flexible unified printer driveruniprint is a unified parametric driver by Gunther Hess <ghess@elmos.de> for several kinds of printers and devices, including
This driver is intended to become a unified printer driver. If you consider it ugly, please send me your suggestions for improvements. The driver will be updated with them. Thus the full explanation of the driver's name is: Ugly- -> Updated- -> Unified Printer Driver But you probably want to know something about the functionality. At the time of this writing uniprint drives:
It can be configured for various other printers without recompilation and offers uncompressed (ugly) Sun rasterfiles as another format, but this format is intended for testing purposes rather than real use. The usage of this driver is quite simple. The typical command line looks like this: gs @{MODEL}.upp -sOutputFile={printable file} MyFile.ps -c quit For example, from my GNU/Linux box: gs @stc.upp -sOutputFile=/dev/lp1 tiger.ps -c quit
Thanks to Danilo Beuche, Guido Classen, Mark Goldberg and Hans-Heinrich Viehmann for providing the files for the stc200, hp690, stc500 and the stc640. Thanks to Michael Lossin <losse@germanymail.com> for the newer st640 parameter sets. Please note the following:
The state of this driverThe coding of uniprint was triggered by the requirements of the various Stylus Color models and some personal needs for HP and NEC drivers. Thus the Epson models are well represented among the distributed parameter files. When this driver entered the beta test phase, three other drivers appreared on the scene that could be at least partially integrated into uniprint: cdj850 by Uli Wortmann (available at http://www.erdw.ethz.ch/~bonk/hp850/hp850.html), hpdj by Martin Lottermoser, and bjc610 by Helmut Riegler. Uli addresses features of the more recent DeskJet models that will not be available in uniprint soon. Martin taught me a lesson on HP-PCL3 headers that will be available in uniprint soon. Helmut in turn followed an almost similar idea, but targetted primarily for printing on Canon printers from the pbmplus library. Starting with version 1.68 of uniprint, BJC support is available. Work on the hpdj integration will start after the update of my website. Notes on uniprint's backgrounduniprint is actually an update of stcolor, but much more versatile than its predecessor; stcolor, in its turn, started as a clone of the color DeskJet family of drivers (cdj*). Finally, cdj* can be considered an addition of features to the simpler monochrome drivers of Ghostscript. This addition of features is useful to get an idea of the functionality of uniprint:
Thus uniprint accumulates almost any features that can be found among the other printer drivers, which clearly has some disadvantage in processing speed -- true in particular of version 1.75, since it was targetted for functionality, and several speed-gaining features were (knowingly) omitted. To summarize and to introduce the terms used in the description of the parameters, the features of uniprint that can be parameterized are:
Godzilla's guide to the creation of Unified Printer Parameter (.upp) filesHere is one of the distributed parameter files (stc_l.upp) with some added comments. Also see the section that describes all uniprint's parameters in brief. -supModel="Epson Stylus Color I (and PRO Series), 360x360DpI, noWeave" -sDEVICE=uniprint -- Select the driver -dNOPAUSE -- Useful with printers -dSAFER -- Provides some security -dupColorModel=/DeviceCMYK -- Selects the color mapping -dupRendering=/ErrorDiffusion -- Selects the color rendering -dupOutputFormat=/EscP2 -- Selects the output format -r360x360 -- Adjusts the resolution -dupMargins="{ 9.0 39.96 9.0 9.0}" -- Establishes (L/B/R/T margins in points) -dupComponentBits="{1 1 1 1}" -- Map: bits per component (default: 8) -dupWeaveYPasses=4 -- Weave: Y-passes (default: 1) -dupOutputPins=15 -- Format/weave: scans per Command -dupBeginPageCommand="< -- Goes to the printer 1b40 1b40 -- ESC '@' ESC '@' -> dual reset 1b2847 0100 01 -- ESC '(' 'G' 1 0 1 -> graphics 1b2869 0100 00 -- ESC '(' 'i' 1 0 1 -> no HW weave 1b2855 0100 0A -- ESC '(' 'U' 1 0 10 -> 360dpi 1b5500 -- ESC 'U' 0 -> bidir print 1b2843 0200 0000 -- ESC '(' 'C' 2 0 xx -> page length 1b2863 0400 0000 0000 -- ESC '(' 'c' 4 0 xxxx -> margins >" -- as it is, unless: -dupAdjustPageLengthCommand -- Adjust page length in BOP requested -dupAdjustTopMarginCommand -- Adjust top margin in BOP -dupAdjustBottomMarginCommand -- Adjust bottom margin in BOP -dupEndPageCommand="(\033@\014)" -- Last (but one) data to the printer -dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)" That's short, and if one removes upWeaveYPasses and upOutputPins it becomes shorter, almost stcany.upp. This miniature size is because I am most familiar with ESC/P2, and was able to add defaults for the omitted parameters. Now a few notes about the parameters used in this example:
If no other weave parameters are given, uniprint computes several defaults which together do no weaving. The /Epson and /EscP2XY formats take care of "upWeaveXPasses" too.
For the ESC/P(2) formats all commands represent binary data, while for the PCL/RTL formatter some of them are formats for fprintf. These strings must explicitly have a trailing "\0'. I should write more, but the only recommendation is to take a look at the various parameter files. Here are a few more hints.
All parameters in briefThis table gives a brief explanation of every parameter known to uniprint, listing them in alphabetical order. "[ ]" denotes that a parameter is an array, and "(RO)" that it is read-only.
uniprint's Roll of HonorI should mention all of the people who were involved in stcolor's evolution, but I've decided to start from scratch here for uniprint: Gunther Hess Duesseldorfer Landstr. 16b D-47249 Duisburg Germany +49 203 376273 telephone (MET evening hours) <ghess@elmos.de> Uniprint weaving parameters howtoThis section was contributed by Glenn Ramsey.
I wrote this because the documentation was very brief and I really struggled with it for a while, but it is very simple once you understand what is going on. This only describes how to work out the Y parameters, I haven't looked at the X parameters yet.
Example: stc.upp from Aladdin Ghostscript 6.0115 nozzles spaced at 1/90 in, 360 dpi requires 4 passes.The following diagram shows which nozzles operate during each pass.-dupWeaveYPasses=4 -dupOutputPins=15 -dupWeaveYFeeds="{15 15 15 15}" -dupWeaveInitialYFeeds="{1 1 1 13}" -dupWeaveInitialPins="{ 4 15 11 7}" Passes 1-4 are beginning of page passes and passes 5-8 are normal passes.
These parameters would also work: -dupWeaveYPasses=4 -dupOutputPins=15 -dupWeaveYFeeds="{14 15 18 13}" -dupWeaveInitialYFeeds="{1 1 1 13}" -dupWeaveInitialPins="{ 4 11 7 15}"
Extension to uniprint for the Epson Stylus Color 300This section was contributed by Glenn Ramsey.
The Epson Stylus Color 300 uses a different command set to other Epson
Stylus Color printers that use the ESC/P2 language. As far as I can
tell its commands are a subset of ESC/P2. In ESC/P2 the colour to be
printed is selected by a 'set colour' command and then the data sent
is only printed in that colour until the colour is changed with another
'set colour' command. The Stylus Color 300 lacks this functionality.
The data sent to the printer maps directly to the ink nozzles and colour
of an output scan line in the printed output is determined by the position
of the scan line within the data. This means that the driver must know
how the nozzles are arranged and must format the output accordingly.
The extension adds a format that I have called EscNozzleMap and adds some
additional parameters to uniprint.
A more detailed description of the new parameters
Example 1 - Epson Stylus Color 300 - 360 dpi colourThe weaving parameters are the same as for any other uniprint driver but they must be consistent with the nozzle map parameters. In this printer the coloured nozzles are spaced at 1/60" so 6 passes are required for 360 dpi resolution.-dupWeaveYPasses=6 -dupOutputPins=11 -dupWeaveYFeeds="{ 11 11 11 11 11 11 }" -dupWeaveInitialYFeeds="{ 1 1 1 1 1 7 }" -dupWeaveInitialPins="{ 2 11 9 7 5 3 }" -dupNozzleMapRowsPerPass=64 -dupNozzleMapPatternRepeat=6 -dupNozzleMapRowMask="{ 2 4 1 3 0 0 }" -dupNozzleMapMaskScanOffset="{ 0 1 2 3 0 0 }" In the example there are 64 rows of data required for each head pass. Each row must be completely filled with data for each pass so if certain nozzles do not print in the pass then the rows for those nozzles will be padded with zeroes. The row mask translates to "C Y K M 0 0" so in the output data rows 0,7,13,... will contain data for cyan, rows 1,8,14,... will contain data for yellow, etc. Rows 4,10,16,... and 5, 11,15,... will always be padded with zeroes. The upNozzleMapPatternRepeat parameter defines the length of the mask. The row mask is repeated for each group of upNozzleMapPatternRepeat rows in the output data. In this case there are 64 rows so there will be 10 groups of "C Y K M 0 0" followed by "C Y K M" which is equivalent to 11 output pins. The upNozzleMaskScanOffset array indicates how the data from the scan buffer is mapped to the output data. The data is presented to the formatter as a buffer of four colour scanlines. The index of the scanline being printed, lets call it y, always corresponds, in this example, to the physical position of the cyan nozzle but since the nozzles are not on the same horizontal line then the other colours for the current pass must come from other scanlines in the scan buffer. The example is { 0 1 2 3 0 0 }, this means that when printing a 4 colour image the magenta data would come from scanline y+3, the black from scanline y+2, etc. It would have been possible in this case to use the array index instead of the upNozzleMaskScanOffset parameter however the parameter is necessary to be able to use the full capability of the printer in black only mode. Example 2 - Epson Stylus Color 300 - 180 dpi black onlyIn this example there is no weaving.-dupMargins="{ 9.0 39.96 9.0 9.0}" -dupWeaveYPasses=1 -dupOutputPins=31 -dupNozzleMapRowsPerPass=64 -dupNozzleMapPatternRepeat=6 -dupNozzleMapRowMask="{ 0 0 1 0 1 1}" -dupNozzleMapMaskScanOffset="{ 0 0 0 0 1 2 }" The ESC300 has black nozzles evenly physically arranged as K K K but the data must be sent to the printer as 00K0KK. This is handled by the upNozzleMapRowMask and upNozzleMaskScanOffset arrays. The upNozzleMapRowMask array is { 0 0 1 0 1 1} which translates to { 0 0 K 0 K K } so rows 0, 1 and 3 will always contain zeros and the other rows will contain data. The upNozzleMaskScanOffset array in this case is { 0 0 0 0 1 2 } so if the data for the 1st nozzle comes from row y in the scan buffer then the data for the 2nd and 3rd nozzles will come from rows y+1 and y+2. Example 3 - Epson Stylus Color 300 - 360 dpi black onlyIn this example 2 weave passes are required to achieve the desired resolution.-dupWeaveYPasses=2 -dupOutputPins=31 -dupWeaveYFeeds="{31 31}" -dupWeaveInitialYFeeds="{1 31}" -dupWeaveInitialPins="{16 31}" -dupNozzleMapRowsPerPass=64 -dupNozzleMapPatternRepeat=6 -dupNozzleMapRowMask="{ 0 0 1 0 1 1}" -dupNozzleMapMaskScanOffset="{ 0 0 0 0 2 4 }" The upNozzleMaskScanOffset array in this case is { 0 0 0 0 2 4 } because there are two weave passes so if the data for the first nozzle comes from row y in the scan buffer then the data for the 2nd and 3rd nozzles must come from rows y+(1*2) and y+(2*2). Glenn Ramsey glennr at users.sourceforge.net February 2001 Sun SPARCprinterThis section was contributed by Martin Schulte. With a SPARCprinter you always buy software that enables you to do PostScript printing on it. A page image is composed on the host, which sends a bitmap to the SPARCprinter through a special SBUS video interface. So the need for a Ghostscript interface to the SPARCPrinter seems low, but on the other hand, Sun's software prints some PostScript drawings incorrectly: some pages contain a thin vertical line of rubbish, and on some Mathematica drawings the text at the axes isn't rotated. Ghostscript, however, gives the correct results. Moreover, replacing proprietary software should never be a bad idea. The problem is that there has yet been no effort to make the SPARCPrinter driver behave like a BSD output filter. I made my tests using the script shown here. InstallationAdd sparc.dev to DEVICE_DEVS and compile Ghostscript as described in the documentation on how to build Ghostscript. Afterwards you can use the following script as an example for printing after modifying it with the right pathnames -- including for {GSPATH} the full pathname of the Ghostscript executable: outcmd1='/vol/local/lib/troff2/psxlate -r' outcmd2='{GSPATH} -sDEVICE=sparc -sOUTPUTFILE=/dev/lpvi0 -' if [ $# -eq 0 ] then $outcmd1 | $outcmd2 else cat $* | $outcmd1 | $outcmd2 fi ProblemsSince /dev/lpi can be opened only for exclusive use, if another job has it open (engine_ctl_sparc or another Ghostscript are the most likely candidates), Ghostscript stops with "Error: /invalidfileaccess in --.outputpage--" In case of common printer problems like being out of paper, a warning describing the reason is printed to stdout. The driver tries access again each five seconds. Due to a problem with the device driver (in the kernel) the reason for printer failure isn't always reported correctly to the program. This is the case, for instance, if you open the top cover (error E5 on the printer's display). Look at the display on the printer itself if a "Printer problem with unknown reason" is reported. Fatal errors cause the print job to be terminated. Apple dot matrix printerThis section was contributed by Mark Wedel <master@cats.ucsc.edu>. The Apple Dot Matrix Printer (DMP) was a parallel predecessor to the Imagewriter printer. As far as I know, Imagewriter commands are a superset of the Dot Matrix printer's, so the driver should generate output that can be printed on Imagewriters. To print images, the driver sets the printer for unidirectional printing and 15 characters per inch (cpi), or 120dpi. It sets the line feed to 1/9 inch. When finished, it sets the printer to bidirectional printing, 1/8-inch line feeds, and 12 cpi. There appears to be no way to reset the printer to initial values. This code does not set for 8-bit characters (which is required). It also assumes that carriage return-newline is needed, and not just carriage return. These are all switch settings on the DMP, and I have configured them for 8-bit data and carriage return exclusively. Ensure that the Unix printer daemon handles 8-bit (binary) data properly; in my SunOS 4.1.1 printcap file the string "ms=pass8,-opost" works fine for this. Finally, you can search devdemp.c for "Init" and "Reset" to find the strings that initialize the printer and reset things when finished, and change them to meet your needs. Copyright © 1996-2002 artofcode LLC. All rights reserved. This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of the license contained in the file LICENSE in this distribution. Ghostscript version 7.07, 17 May 2003 |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0033 ]-- |