Copyright (C) 1992, 1995 Aladdin Enterprises. All rights reserved. This file is part of Aladdin Ghostscript. Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or distributor accepts any responsibility for the consequences of using it, or for whether it serves any particular purpose or works at all, unless he or she says so in writing. Refer to the Aladdin Ghostscript Free Public License (the "License") for full details. Every copy of Aladdin Ghostscript must include a copy of the License, normally in a plain ASCII text file named PUBLIC. The License grants you the right to copy, modify and redistribute Aladdin Ghostscript, but only under certain conditions described in the License. Among other things, the License requires that the copyright notice and this notice be preserved on all copies. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This file, devices.txt, gives more detailed documentation about certain specific devices for which Ghostscript can produce output. For an overview of Ghostscript and a list of the documentation files, see README. Devices for which this file currently contains documentation: SPARCprinter HP DeskJet 520, 540, and 560C HP DeskJet 500C & 550C HP PaintJet, XL, and XL300 DEC LJ250 Apple Dot Matrix Printer (and Imagewriter) Epson Stylus Color Printer Canon BJC-600/BJC-4000/BJC-70 and BJC-800 BubbleJet Color Printers (and Apple StyleWriter 2x00) ### ------------------------- The SPARCprinter ------------------------- ### This section was written by Martin Schulte. Introduction ------------ The SPARCprinter is is connected to SPARCStation via a special SBUS card's video inferface, the picture is composed on the host and only a bitmap is send to the printer unit. Together with a SPARCprinter, you always buy (as far as I know) software that enables you to do postscript-printing on your SPARCPrinter. So, the need for a Ghostscript-Interface to the SPARCPrinter seems low, but on the other hand some Postscript drawings are not correctly printed with SUN's software: on some pages occured a thin vertical line of rubbish (reproducable), on some Mathematica drawings the text at the axes wasn't rotated. I tried all of these with Ghostscript and always got the expected results. However, 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 mentioned under Installation. Installation ------------ Add sparc.dev to DEVICE_DEVS and compile ghostscript as described in make.txt. Afterwards, you can use the following script (the way of handling standard input versus filename-arguments doesn't look very clever, has anyone a better idea ?) to print if you substitute by the place where you installed the ghostscript binary: outcmd1='/vol/local/lib/troff2/psxlate -r' outcmd2=' -I/home/schulte/gs252 -sDEVICE=sparc -sOUTPUTFILE=/dev/lpvi0 -' if [ $# -eq 0 ] then $outcmd1 | $outcmd2 else cat $* | $outcmd1 | $outcmd2 fi Problems -------- Since /dev/lpvi can only be opened for exclusive use, another job having opened it (engine_ctl_sparc or another ghostscript as the most probable canidates) will cause to stop ghostscript with "Error: /invalidfileaccess in --.outputpage--" In case of common printer problems like out of paper, a warning describing the reason will be printed to stdout, the driver will try to access again and again each five seconds. Due to a problem with the device-driver (in the kernel) the reason of printer failure is not always correctly reported to program. This is the case at least if you open the top cover (Error in the display: E5). Look to the display at the printer if a "Printer problem with unknown reason" is reported. Fatal errors will cause the print-job to be terminated. ### ------------------------------ End --------------------------------- ### ### ------------------- H-P color inkjet printers ---------------------- ### ### (DeskJet 500C, DeskJet 550C, PaintJet, PaintJet XL, PaintJet XL300 ### ### and the DEC LJ250 which can operate in a Paintjet-compatible mode) ### This section was written by George Cameron. Information and tips on usage for the drivers contained in gdevcdj.c ==================================================================== OVERVIEW: There are 6 generic drivers contained in the source module: 1 - cdj500: HP DeskJet 500C and 540C 2 - cdj550: HP DeskJet 550C and 560C 3 - pjxl300: HP PaintJet XL300 and DeskJet 1200C 4 - pjtest: HP PaintJet 5 - pjxltest: HP PaintJet XL 6 - declj250: DEC LJ250 All of 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 gs command line, eg. gs -sDEVICE=cdeskjet -dBitsPerPixel=16 -dDepletion=1 -dShingling=2 tiger.ps NB/ The old names cdeskjet, cdjcolor and cdjmono drivers have been retained; however, their functionality duplicates that available using the above drivers (and cdeskjet is identical to cdj500), ie. we can use: gs -sDEVICE=cdj500 -dBitsPerPixel=24 ... for cdjcolor, and gs -sDEVICE=cdj500 -dBitsPerPixel=1 ... for cdjmono DEFAULT PAPER SIZE: If the preprocessor symbol A4 is defined, the default paper size is the European A4 size; otherwise it is the U.S. letter size (8.5"x11"). Other paper sizes (including A3 for the PaintJet XL and PaintJet XL300) may be specified on the command line as explained in the Ghostscript documentation. DEFAULT BITS-PER-PIXEL: If the preprocessor symbol BITSPERPIXEL is defined as an integer (see below for the range of allowable values), this number will be used to define the default bits-per-pixel (ie. bit depth) for the generic drivers. If the symbol is not defined, the default is set to 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. DESKJET PHYSICAL LIMITS: Maximum printing width = 2400 dots = 8". The printer manuals say that the maximum recommended printing height on the page is 10.3", 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 1/2" unprintable bottom margin, due to the mechanical arrangement used to grab the paper. Side margins are approximately 0.25" for US Letter paper, and 0.15" for A4. 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 as eg. gs -dBitsPerPixel=32 -dShingling=1 ... which sets the BitsPerPixel parameter to 32 and the Shingling parameter to 1. BITS-PER-PIXEL: All of the drivers in gdevcdj.c accept a command line option to set the BitsPerPixel property. This gives considerable flexibility in choosing various trade-offs between speed/quality/colour etc. The valid numbers are: 1: This is a standard Ghostscript monochrome driver, and uses black ink (by installing the separate mono cartridge in the case of the DeskJet 500C, or automatically for the other printers) 3: 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. 8: 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. 16: This is a 'cheaper' version of the following (24-bit) driver, which generates a Floyd-Steinberg colour dithered output using the minimum amount of memory (this may be helpful when using IBM PC's when Ghostscript has not been compiled using a 32-bit 386-style compiler). The quality can be almost as good as the 24-bit version. 24: 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 (and it tends to produce rather larger raw data files, so they can also be slower to print). 32: This is for the DeskJet 550C only, which uses the black cartridge and the colour cartridge simultaneously (ie. CMYK printing). This printer can be both 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 very small.) DESKJET PROPERTIES: The addional properties available for the DeskJets are: BlackCorrect (int) /* Colour correction to give * better blacks when using the DJ500C * in colour mode, eg. the default of 4 * reduces the cyan component to 4/5 * Range accepted: 0 - 9 (0 = none) */ Shingling (int) /* Interlaced, multi-pass printing * 0 = none, 1 = 50%, 2 = 25%, 2 is * best & slowest */ Depletion (int) /* 'Intelligent' dot-removal * 0 = none, 1 = 25%, 2 = 50%, 1 best * for graphics? * Use 0 for transparencies */ PAINTJET XL300/PAINTJET XL PROPERTIES: PrintQuality (int) /* 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 * max number of passes, ie. slowest * printing for highest quality */ RenderType (int) /* 0 = driver does dithering * 1 = snap to primaries * 2 = snap black -> white, others to black * 3 = ordered dither * 4 = error diffusion * 5 = monochrome ordered dither * 6 = monochrome error diffusion * 7 = cluster ordered dither * 8 = monochrome cluster ordered dither * 9 = user-defined dither (not supported) * 10 = monochrome user-defined dither ns. */ PAINTJET PROPERTIES: No additional properties GAMMA CORRECTION: 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" or 1/300" 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, eg. gs ... gamma.ps colorpic.ps -c quit where gamma.ps is %! {0.333 exp} dup dup currenttransfer setcolortransfer This example sets the gamma for r, g, and b to 3, which seems to work reasonably well in practice. GENERAL TIPS: For all the above printers, the paper is critically important to the final results. Smoother, less fibrous paper is generally better (and suggested types are given in the printer manuals). In particular, the special ink-jet paper can make a big difference; the 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-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 testing drivers for the additional machines and reporting their findings back to me. HP's 600x300 dpi resolution-enhanced mode for inkjet printers ============================================================= 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: These printers do not offer true 600x300 dpi resolution. Those that print in colour are strictly 300x300 dpi in colour mode, while in mono mode there is a pseudo 600x300 dot mode, with the restriction that you can't print two adjacent dots. Thus, in effect what you have is 600 dpi dot positioning, but on average you don't get more dots per line. What this does give is the possibility to have eg. sharper character outlines, as 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. ### ------------------------------ End --------------------------------- ### ### ------------------- Apple Dot Matrix Printer ---------------------- ### This section was written by Mark Wedel. The Dot Matrix Driver (DMP) driver is a simple driver I wrote. It could more more efficient, but it seems to print the images fine. The Dot Matrix Printer was a parallel predecessor to the Imagewriter printer. As far as I know, the Imagewriter commands are a superset to those of the Dot Matrix printer, so the driver should work fine at generating output that can be printed on Imagewriters. A few notes (from the gdevadmp.c file): * To print out images, it sets the printer for unidirection printing * and 15 cpi (120 dpi). IT sets line feed to 1/9 of an inch (72 dpi). * When finished, it sets things back to bidirection print, 1/8" line * feeds, and 12 cpi. There does not appear to be a way to reset * things 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 cr only. * * You can search for the strings Init and Reset (in devdemp.c) to find the * strings that set up the printer and clear things when finished, and change * them to meet your needs. * * Also, you need to make sure that the printer daemon (assuming unix) * doesn't change the data as it is being printed. I have set my * printcap file (sunos 4.1.1) with the string: * ms=pass8,-opost * and it works fine. Mark Wedel master@cats.ucsc.edu ### ------------------------------ End --------------------------------- ### ### ------------------ The Epson Stylus Color printer ------------------ ### /* Epson Stylus-Color Driver, contributed by Gunther Hess (address: see below) I N T R O D U C T I O N ======================= This documentation accompanies version 1.90 of the stcolor-driver. Compared to version 1.21 (gs3.53) there are just a few, but somehow important chages: - Default: noWeave escpBand=1 (-> default works with all known models) - added Parameter "Softweave" (useful only with Original STC and PRO-Series) - added Compile-Option (-DSTC_SIGNAL) to catch interrupts during printing (thanks to Frederic Loyer) - compatibility with ansi2knr - compatibility with 64Bit Processors - clarification of usage with Pro-XL and Stylus Color II A Note on the Version-Numbering: Version 1.xx comes to it's end. Any 1.xx > 1.90 will have only Bug-Fixes. Maybe that Version 2.xx comes to life, if this is the case it will include full support of the newer models. U S A G E ========= This driver is selected with "-sDEVICE=stcolor" and produces 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 the monochrome-versions of this printer. This can be achieved either via command-line options or via ghostscript-input. For convienience a Postscript-File is supplied, that can be used as initial inputfile. Thus, assumed that ghostscript is invoked via "gs" on your computer, try the following command: gs -sDEVICE=stcolor -rXDPIxYDPI stcolor.ps ... (e.g.: your input-files) were XDPI is one of 180/360/720 and YDPI is one of (90/)180/360/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 ghostscript input-directory. Thus if ghostscript is part of your printer-spooler, you can insert (stcolor.ps) findlibfile { pop run } if pop to the files you want to run through the improved algorithms and you may want to adapt this file to your specific needs. The methods and options for this are described here, but this description is restricted to the gs-options, while their manipulation at the Postscript-level is documented in "language.txt" and in the mentioned "stcolor.ps". Next thing is to explain the options (as written on my unix-system). The order is somehow related to their use during the printing-Process: -dUnidirectional - Force unidirectional printing, recommended for transparencies -dMicroweave - enable the printers "microweave"-feature. -dnoWeave - disable any Weaving, overrides -dMicroweave -dSoftweave - enable internal weaving of the driver. * Weave-Note: Softweave works *ONLY* with the original Stylus-Color * and the PRO-Series. -sDithering="name" - select another dithering-algorithm, available are: "gscmyk" : fast color-output, with CMYK-ProcessColorModel [D] "gsmono" : fast black & white output "gsrgb" : fast color-output, with RGB-ProcessColorModel "fsmono" : Floyd-Steinberg, Monochrome "fsrgb" : Floyd-Steinberg, with RGB-ProcessColorModel (Almost identical to cdj550/mjcxxx-Algorithm) "fsx4" : Floyd-Steinberg, with CMYK-ProcessColorModel (shares code with fsmono & fsrgb, but is algorithmically really bad) "fscmyk" : Floyd-Steinberg, with CMYK-ProcessColorModel and proper modifications for CMYK "hscmyk" : modified Floyd-Steinberg with CMYK-Model ("hs" stands for "hess" nor for "high speed", but the major difference to "fscmyk" is speed) "fs2" : algorithm by Steven Singer (RGB) should be identical to escp2cfs2. -dBitsPerPixel=1...32 - number of bits used for pixel-storage, the larger the value, the better the quality - at least in theory. In fsrgb one can gain some speed, when restricting to 24 Bits, rather than the default of 30. -dFlag0 - causes some algorithms to select a uniform initialisation rather than a set of random-values. May yield "sharper" image-impression at the cost of "dithering-atrefacts". (applies to hscmyk and all fs-modi, except for fs2, which always uses a constant initialization.) -dFlag1 ... -dFlag4 - available to future algorithms. -dColorAdjustMatrix={3/9/16 x float}' - This is a Matrix to adjust the colors. Values should be between -1.0 and 1.0, and the number of values depend on the colormodel used by the selected algorithm. In RGB- and CMYK-modi a matrix with 1.0 on the diagonal produces no transformation. (I could not identify a similar feature at the language-level, so this option was implemented, it is really required, but I don't know reasonable values yet.) -dCtransfer='{float float ...}', -dMtransfer=..., -dY..., -dK... or -dRtransfer='{float float ...}', -dG..., -dB... or -dKtransfer='{float float ...}' - which is used, depends on the algorithm, which maybe either either CMYK, RGB or monochrome. The values are arrays of floats in the range from 0 to 1.0, which represent the visible color-intensity for the device. One may achieve similar effects with "setcolortransfer" at the language-level, but this takes more time and the underlying-code for the driver-specific parameters is still required. The size of the arrays is arbitrary and the defaults are {0.0 1.0}, which is a linear characteristic, most of the code in "stcolor.ps" are better transfer-arrays. -dKcoding='{float...}', -dC..., -dM... etc. - this are again arrays between 0.0 and 1.0, and they control the internal coding of the color-values. Clever usage of this arrays may yield further enhancements, but no experience yet. [To be discontinued with version >= 2.x] -sModel=st800 - causes output to be suitable for the monochrome Stylus 800 (no Weaving, no Color). -sOutputCode= - can be either "plain", "runlength" or "deltarow" and changes the ESC/P2 (TM) coding-technique used by the driver. The default is to use the runlength-encoding. "plain" selects uncompressed encoding and yields enormeous amounts of data to generated. -descp_Band=1/8/15/24 - Number of Nozzles of scanlines used in printing. Useful only with -dnoWeave. Larger Values yield smaller code, but this doesn't increase the Printing-Speed. -descp_Width= - Number of Pixels Printed in each scan-Line. (Useful when tuning Margins only, se below) -descp_Height= - Length of the entire Page in Pixels (Parameter of "ESC(C" in default initialization) -descp_Top= - Top-Margin in scanlines. (1st Parameter of "ESC(c" in default initialization) -descp_Bottom= - Bottom-Margin in scanlines. (2nd Parameter of "ESC(c" in default initialization) -sescp_Init="..." - Override for the initialization-sequence. (Must set Graphics-Mode-1 & Units) -sescp_Release="..." - Overrides the release-sequence. (ESC @ FF by default) Valid Resolutions: any, ESC/P2 allows in theory, but only the following are known to work with most printers: -r360x360 (Default) -r720x720 (not on STC-IIs ? and st800) Valid Option Combinations: (Stylus I & PRO-Series only) escp_Band ?Weave escp_Band/#Passes 180x 90 15 no-Weave 180x180 1 , 8, 24 no/u-Weave 15/2 sWeave 180x360 15/4 sWeave 180x720 15/8 sWeave 360x 90 15 no-Weave 360x180 1, 8, 24 no/u-Weave 15/2 sWeave 360x360 1, 8, 24 no/u-Weave 15/4 sWeave 360x720 15/8 sWeave 720x 90 15 no-Weave 720x180 15/2 sWeave 720x360 15/4 sWeave 720x720 1 no/u-Weave 15/8 sWeave ************************************************************************* ************************************************************************* ** ** ** BEWARE: There are only few validity-checks for parameters. A good ** ** example is "escp_Band": if you set this, the driver tries ** ** to use your value, even if this value is not supported by ** ** the printer: ** ** ** ** YOU ASKED FOR IT, AND YOU GOT IT! ** ** ** ************************************************************************* ************************************************************************* A P P L I C A T I O N - N O T E ================================ Quite 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 50 Times, I prepared a STC-FAQ-Collection. I am currently unable offer this FAQ on the net. But thanks to Bill Davidson it is available as: http://www.isisnet.com/bdavidson/gs_stc.FAQ.html And here it comes (as plain text): VERSION: This FAQ refers to ghostscript > 3.50 with stcolor > 1.20. The former release (ghostscript-3.33/stcolor-1.12) used different parameters and had some severe bugs. This FAQ is itself version 1.3. TOPIC: Pro XL? Yes, this driver supports the A3-Size Printer. Simply set the required pagesize and margins. A simple way to do this, is to specify the parameter "-sPAPERSIZE=a3" on the commandline or to include the procedure-call "a3" in the postscript-Prolog section. If you want to optimize the printable area and/or set the proper Margins, see topic Margins, PageSize. TOPIC: Margins, PageSize Different than other drivers, i refuse to add code to the stcolor-driver, that tries to guess the proper margins or pagesize. This is due to the fact, that i found that such guessing is usually wrong and needs correction either in the source or the parameters. The following code can be inserted to "stcolor.ps" after the line: mark % prepare stack for "putdeviceprops" And this is the new code: /.HWMargins [9.0 39.96 12.6 9.0] % Left, Bottom, Right, Top (1/72") /PageSize [597.6 842.4] % Paper, including Marings (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 for ".HWMargins" and "PageSize" to match your needs. The given Values are the defaults from the driver, when compiled with "-DA4" set. This Option -or it's omission- may cause trouble: The Stylus Color can print exactly 8" or 2880Pixel@360DpI. The remaining paper is the margin, where the left margin varies only slightly with the papersize, while the right margin ist significantly increased for wider paper, such as letter. -> If you are using stcolor > 1.20, compiled without "-DA4", on european paper, then the Default-Margin is too large. You need to add the proper ".HWMargins" to the commandline or stolor.ps TOPIC: Stylus Color II / IIs and 1500. First the good news: The driver can print on the Stylus Color II. And the bad ones: - According to Epson-Support the driver "abuses" the color-capabilities. (See topic "Future Plans" for details.) - You need some parameters on the command-line (or in stcolor.ps). - I doubted that it would be usable with the Stylus Color IIs. *BUT* it is usable and suffers from the mixing-Problems!!. To make thinks work, you *MUST* disable the drivers internal weaving ("Softweave"). This can be done in two ways: gs .... -dMicroweave .... or gs ... -dnoWeave -descp_Band=1 .... [1.90 fixes this "bug" due to a changed default-behaviour] I experienced significantly increased printing speed with the second variant on the old Stylus Color, when printing mostly monochrome data. TOPIC: Future Plans Actually i thought, that the driver is finished by now, but an answer from Epson triggered future development. This was the answer from Epson-Support: To: Klaus-Gunther Hess Subject: Help: Need Programming Info for Stylus-(Color)-Printers The differentiation is necessary, as the printers produce the graphics differently. To wit: CMY Class - ( Stylus Color IIs ) The Stylus Color IIs prints color graphics with the three different color inks (cyan, magenta, and yellow). Also, black is printed using composit black (mixture of CMY). For high quality laser like black, a separate black ink cartridge should be used. CMY + K Class - ( Stylus Color II ) This printer has both a CMY and a black ink (K) cartridge installed at the same time. However, due to the nature of the black ink it can not be mixed or overlaid with the color inks. Therefore, when black is needed, composite black is used. If the image calls for pure black (e.g., text), the black cartridge is used. CMYK Class - ( Stylus Color, Stylus Pro and Pro XL ) These printers have a mixable black (K) ink. This ink is compatible with the CMY inks and will not bleed when combined or printed next to the CMY inks. Bruce U. The Epson Connection Thus I am working on a version, that supports CMY and CMY + K dithering. Actually there are also some new (*undocumented*) instructions used by the windows-driver in conjunction withe the Stylus Color II/IIs, that raises the need for some more "escp_*" Parameters. A C K N O W L E D G E M E N T S =============================== This driver was "copied" from gdevcdj.c (ghostscript-3.12), which was contributed by: George Cameron - g.cameron@biomed.abdn.ac.ukis Koert Zeilstra - koert@zen.cais.com Eckhard Rueggeberg - eckhard@ts.go.dlr.de Some of the ESC/P2-code was drawn from gdevescp.c, contributed by Richard Brown - rab@eos.ncsu.edu The POSIX-Interrupt-Code is from (Compile-Time-Option -DSTC_SIGNAL) Frederic Loyer - loyer@ensta.fr And several improvements are based on discussions with Brian Converse - BCONVERSE@ids.net Bill Davidson - bdavidson@ra.isisnet.com Gero Guenther - gero@cs.tu-berlin.de Jason Patterson - jason@reflections.com.au ? Rueschstroer - rue@ibe.med.uni-muenchen.de Steven Singer - S.Singer@ph.surrey.ac.uk While I wish to thank all this people mentioned above, they are by no means responsible for bugs in the stcolor-driver - just for the features. Duisburg 8-May-1996, Gunther Hess up to sometime E-Mail: gunther@elmos.de After that time, one should use snail-mail or phone: Gunther Hess phone: ++49 203 376273 Richard Wagner Strasse 112 D-47057 Duisburg Germany R E C O M M E N D A T I O N S ============================= The next section is a contribution from Jason Patterson who evaluated a previous version (1.17). GhostScript was invoked as follows: gs -sDEVICE=stcolor [-r720x720] -sDithering=... -sOutputFile=escp.out \ stcolor.ps whatsoever.ps 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* it would not allow the selection of "gscmyk". So here comes a very truncated version of Jasons text: COLOR DITHERING EXPERIMENTS with gdevstc-1.21 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here's a bit of feedback about the EPSON Stylus Color driver's different dithering methods, based on a little experiment using 4 good quality scanned images of quite varied nature. Here is a summary of the results of the four experiments... gsmono: Pretty much what you'd expect from a mono ordered pattern. Looks like what a lot of mono laser printers produce. fsmono: Excellent for monochrome. gscmyk: Not very good, but then you'd expect that from an ordered pattern. gsrgb: A little better than gscmyk. More consistent looking. fs2: Good, but not quite as good as fsrgb. Gets the brightness wrong, too light at 720dpi, too dark at 360dpi. fsrgb: Very good, but a little too dark and has a slight blue tint. hscmyk: Excellent. Slightly better than fsrgb and fs2. Better than fscmyk on some images, almost the same on most. fscmyk: Best. Very, *very* slightly better than hscmyk. On some images, nearly as good as the EPSON demos (which were done with the MS-Windows driver). Overall Visual Quality (out of ten): gsmono |********* fsmono |***************** | gscmyk |******** gsrgb |********* fs2 |**************** fsrgb |***************** hscmyk |****************** fscmyk |****************** +--------------------- 0 1 2 3 4 5 6 7 8 9 10 best-to-worst order: color: fscmyk hscmyk fsrgb fs2 gsrgb gscmyk mono: fsmono gsmono SANITY NOTE: The above results are only from *four* images, a total of 24 printouts (8 on 720dpi paper, 16 on plain paper). Your results will almost certainly vary, and your standards might not be the same as mine, so use these results as a *guide* only, not as a formal evaluation. C O L O R - T R A N S F O R M A T I O N ======================================= *NOTE*: Things are changing with version gdevstc > 2.00! In 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. This is the result of 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, that provides 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 influences directly 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: ColorAdjustMatrix Coding Transfer +---------------------+ +---------------------+ +------------------+ | Ghostscript Color | | Ghostscript Raster | | Dithering Data | | | => | 1/2/4/8/16/24/32Bit | => | 1/3/4x Values | | 1/3/4x16Bit Values | | for all components | | (arbitrary type) | +---------------------+ +---------------------+ +------------------+ Due to the limitations on raster-storage, information is lost in the first transformation step, except for the 16Bit Monochrome-Mode. So any color adjustment should take place before this step and this is where the optional ColorAdjustMatrix works. The first transformation-step is called "coding" and is controlled by the ?coding-Arrays. The Decoding-process expands the range of values pontentially to a larger range than that provided by the initial ghostscript color-model. It is therefore a reasonable place to make device- and/or algorithm-specific adjustments. This is the place 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 internaly algorithm-specific array-access. If 8Bits are stored per color-component and if the algorithm uses bytes too, the second transformation is included within the first, what saves significant computation-time when printing the data. ColorAdjustMatrix ----------------- The driver supports different "ProcessColorModel"-Values, which raises the need for different color-adjustments. In the following "CAM" stands for ColorAdjustMatrix: DeviceGray: (3 Floats): if((r == g) && (g == b)) K' = 1.0 - R; else K' = 1.0 - CAM[0] * R + CAM[1] * G + CAM[2] * B; According to the documentation in drivers.txt, the latter should never happen. DeviceRGB: (9 Floats) if((r == g) && (g == b)) R' = B' = G' = R; else R' = CAM[0]*R + CAM[1]*G + CAM[2]*B; G' = CAM[3]*R + CAM[4]*G + CAM[5]*B; B' = CAM[6]*R + CAM[7]*G + CAM[8]*B; The Printer uses always four inks, thus a special treatment of black is provided. Algorithms may take special action, if r==g==b. Maybe that in future versions Kcoding & Ktransfer become active in RGB-Mode. DeviceCMYK: (16 Floats) if((c == m) && (m == y)) K' = max(C,K); C' = M' = Y' = 0; else K = min(C,M,Y); if((K > 0) && ColorAdjustMatrix_present) { => UCR C -= K; M -= K; Y -= K; } C' = CAM[ 0]*C + CAM[ 1]*M + CAM[ 2]*Y + CAM[ 3]*K; M' = CAM[ 4]*C + CAM[ 5]*M + CAM[ 6]*Y + CAM[ 7]*K; Y' = CAM[ 8]*C + CAM[ 9]*M + CAM[10]*Y + CAM[11]*K; K' = CAM[12]*C + CAM[13]*M + CAM[14]*Y + CAM[15]*K; Again we have a special black-treatment. "max(C,K)" was introduced because of a slight misbehaviour of ghostscript, that delivers black under certain circumstances as (1,1,1,0). Normally, when no special "Black Seperation" and "Undercolor Removal" procedures are defined at the postscript-level, either (c,m,y,0) or (0,0,0,k) values are mapped. This would make the extended ColorAdjustMatrix quite tedious, thus during mapping black-seperartion is done for (c,m,y,0)-Requests and if there is a ColorAdjustMatrix, undercolor- removal is used too. In other words the Default-Matrix is: 1 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 and it is applied to CMYK-Values with seperated and removed Black. Raising the CMY-Coefficients while lowering the K-coefficients reduces black and intensifies color. But be careful, even low deviations from the default cause drastic changes. If no ColorAdjustMatrix is set, the matrix-computations are skipped. Thus the transformation reduces to: - Range-Inversion in Monochrome-Mode - Black-Separation in CMYK-Mode RGB/CMYK-coding & -transfer and BitsPerPixel -------------------------------------------- This two (groups) of parameters are arrays of floatingpoint-numbers in the range 0.0 to 1.0. They control the truncation to the desired number of bits stored in the raster-memory (BitsPerPixel) and the ink-density. The "truncation" may become a nonlinear-function, if any of the ?coding-arrays are set. Assume the following Ghostscript invocation: gs -sDEVICE=stcolor -sDithering=fscmyk -dBitsPerPixel=16 \ -dMcoding='{ 0.0 0.09 0.9 1.0 }' \ -dYtransfer='{ 0.0 0.09 0.9 1.0 }' \ -dKcoding='{ 0.0 0.09 0.9 1.0 }' -dKtransfer='{ 0.0 0.09 0.9 1.0 }' \ We may have ?coding and/or ?transfer, thus four combinations are possible and this four combinations appear in the given example. The resulting mapping is given in the following tables, where except for the internal Indices (4 Components * 4 Bits = 16 BitsPerPixel), all values are normalized to the Range 0-1. The actual range is 0 to 65535 for the ghostscript-color and 0 to 16777215 (2^24-1) 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", what should give you a graphical printout of the following numbers, when you issue a "showpage"-command: CYAN MAGENTA CI/15 gs_color_values CI ink gs_color_values CI ink 0.000 0.000 - 0.062 0 0.000 -0.123 - 0.123 0 0.000 0.067 0.063 - 0.125 1 0.067 0.123 - 0.299 1 0.247 0.133 0.125 - 0.187 2 0.133 0.299 - 0.365 2 0.351 0.200 0.188 - 0.250 3 0.200 0.365 - 0.392 3 0.379 0.267 0.250 - 0.312 4 0.267 0.392 - 0.420 4 0.406 0.333 0.313 - 0.375 5 0.333 0.420 - 0.447 5 0.433 0.400 0.375 - 0.437 6 0.400 0.447 - 0.475 6 0.461 0.467 0.438 - 0.500 7 0.467 0.475 - 0.502 7 0.488 0.533 0.500 - 0.562 8 0.533 0.502 - 0.529 8 0.516 0.600 0.563 - 0.625 9 0.600 0.529 - 0.557 9 0.543 0.667 0.625 - 0.687 10 0.667 0.557 - 0.584 10 0.571 0.733 0.688 - 0.750 11 0.733 0.584 - 0.612 11 0.598 0.800 0.750 - 0.812 12 0.800 0.612 - 0.639 12 0.626 0.867 0.813 - 0.875 13 0.867 0.639 - 0.715 13 0.653 0.933 0.875 - 0.937 14 0.933 0.715 - 0.889 14 0.778 1.000 0.938 - 1.000 15 1.000 0.889 - 1.111 15 1.000 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 16 component-indices. If no coding-array is given, this is accomplished by a division with 4096 -equivalent to a right-shift by 12 Bits-. The final ink-density resides in the given interval and moves form the left to the right side from 0 to 15. In the Magenta-case, 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 BLACK CI/15 gs_color_values CI ink gs_color_values CI ink 0.000 0.000 - 0.062 0 0.000 -0.123-0.123 0 0.000 0.067 0.063 - 0.125 1 0.018 0.123-0.299 1 0.067 0.133 0.125 - 0.187 2 0.036 0.299-0.365 2 0.133 0.200 0.188 - 0.250 3 0.054 0.365-0.392 3 0.200 0.267 0.250 - 0.312 4 0.072 0.392-0.420 4 0.267 0.333 0.313 - 0.375 5 0.090 0.420-0.447 5 0.333 0.400 0.375 - 0.437 6 0.252 0.447-0.475 6 0.400 0.467 0.438 - 0.500 7 0.414 0.475-0.502 7 0.467 0.533 0.500 - 0.562 8 0.576 0.502-0.529 8 0.533 0.600 0.563 - 0.625 9 0.738 0.529-0.557 9 0.600 0.667 0.625 - 0.687 10 0.900 0.557-0.584 10 0.667 0.733 0.688 - 0.750 11 0.920 0.584-0.612 11 0.733 0.800 0.750 - 0.812 12 0.940 0.612-0.639 12 0.800 0.867 0.813 - 0.875 13 0.960 0.639-0.715 13 0.867 0.933 0.875 - 0.937 14 0.980 0.715-0.889 14 0.933 1.000 0.938 - 1.000 15 1.000 0.889-1.111 15 1.000 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, what is exactly the same functionaltity, that Postscripts "(color)transfer"-function provides. While in the case of Yellow, the intervals match the intervals used with Cyan, the inetervals used for Black match the Magenta-Intervals, but watch the corespondence between the CI/15-values and the Ink-Density for Black: This is a linear distribution in the Ink-domian. Not a bad idea, I think. Consider the fs2-algorithm: It uses values in the range 0-255 (Bytes). If any transfer-array would be supplied alone, some of the 256 possible values would never be used and others will be used for adjacent intervals several times. Establishing an identical coding-array solves this problem, so that the full potential of the algorithm is utilized. Another useful feature of the coding-arrays is, that they are internally normalized to the 0-1 Range. In the 720x720Dpi-Mode the transfer-arrays in stcolor.ps limit the Dot-Density to about 50%, thus this arrays end at 0.5 (respectively start at 0.5 in the RGB-case). Due to the automatic normalization this arrays can be used as coding-arrays too. But of course in the fs2-case mentioned above, values from 0-127 will never be deliverd to the algorithm, while values 128-255 are delivered for adjacent intervals. To clearify the intended use of the three parameters/parameter-groups the following statements should be kept in mind: - ColorAdjustMatrix is never used, when transferring gray-values. This restricts it to what the name says: Adjustment of Colors e.g. the correction for miscolored ink. Do not use it for staturation or brightness-control. - ?transfer-arrays control the values delivered to the driver, which in turn controls the ink-quantity. This arrays should be used for control of saturation and brightness. Maybe that a Postscript-Header for the manipulation of brightness and so on will be provided with future versions. In general this arrays are identical for all inks. If they differ they provide a simpler scheme for color-correction, which is not necessarily faster than the ColorAdjustMatrix. - ?coding-arrays control the color-value-intervals mapped to the internal color-indices. P R I N T - M O D I =================== The parameters "Unidirectional", "Microweave", "noWeave", "OutputCode", "Model" and the given resolution provide control over the data generated for the printer. Unidirectional -------------- Simply toggles the unidirectional-mode of the printer. Setting "Unidirectional" definitly decreases printing-speed, but may increase the quality. I use this for printing tranparencies, where fast head-movement could smear the ink. Microweave, noWeave and OutputCode=deltarow ------------------------------------------- The first are two Booleans, what immediatly tells, that 4 combinations are possible. Actually only three exist (if you don't count for deltarow): 1. Softweave 2. Microweave 3. noWeave First and second are functionally identical, their difference is that either the driver or the printer does the job. So the question What is weaving ? arises. The Epson Stylus Color has a Head-Assembly that contains two physically identifiable Heads. One for Black and one for Cyan/Magenta/Yellow. This makes 4 logical Heads, one for each color-component. Each of this four heads has several jets at some Y-distance, so several horizontal lines can be printed during one pass of the heads. From the experience I think there are 15 Jets per color spaced at 1/90". So the question arises, how to print at a Y-Resolution of 360Dpi with this 90DpI-Jets. Simply by divison, one gets 360/90 = 4, what tells us, that 4 Passes of the head-assembly are required to achieve a Y-resolution of 360DpI. Weaving is just the scheme how the 15 jets are utilized to print adjacent horizontal rows: Weaving noWeave Pass: 1 2 3 4 1 2 3 4 0/360" jet0 - - - jet0 - - - 1/360" - jet1 - - - jet0 - - 2/360" - - jet2 - - - jet0 - 3/360" - - - jet3 - - - jet0 4/360" jet1 - - - jet1 - - - 5/360" - jet2 - - - jet1 - - 6/360" - - jet3 - - - jet1 - .... Now let us 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 the some averaging takes place. Without weaving adjacent rows are printed by the same jet and this makes the dot-diameter-deviations visible as 1/90"-stripes in the printout. In Softweave-Mode (the default) the driver sends the data properly arranged to the printer, while in Microweave-Mode the printer does the same job. But in general the host-processor is much faster than the printers processor and thus it is advantageous to let the host do this job. In addition to that, for 720DpI 8 Passes are required and the amount of buffer-space required to buffer the data for the passes is far beyond the printers memory. SoftWeave requires an odd value of "escp_Band", the Stylus Color provides 15 for that. "OutputCode" controls the encoding used. In the basic modi, the choice consists of "plain" and "runlength". The computation of runlength-encoded data does not take much time, at least less than the datatranfer 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, since there were not potential advantages found, "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 increased printing-speed - things tend to become slower with deltarow compared to Softweave. Model ----- Some 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 ommits some parts of the initialization-sequence, which are not compatible with the given printer model. Currently only "st800" is supported besides the default (stcolor). BEWARE: BUGS & PITFALLS ======================= * The given ?coding and ?transfer arrays should be strictly monotonic. * It is impossible to change WHITE: that's your paper. Thus R/G/B-transfer should end at 1.0 and C/M/Y/K-transfer should start at 0.0. * Usually 8Bits per component yields fastest operation. * The ColorAdjustMatrix is not used in the reverse-transformation, which is used, when Gostscript does the dithering (gs*-Modi). Expect funny results. * If BitsPerPixel is less than 6, the entire coding/transfer-process does not work. This is always true for the gs*-modi and becomes true for the other modi, if BitsPerPixel is forced to low values. * 720x720Dpi-Printing should never select the gs-modi and should always use stcolor.ps. (I prefer 360x720) T E S T S (version 1.13 and above) ================================== This section should give an overview over the performance in terms of processing- & printing-time. Printing is done offline (via cp-instruction) to measure real printing-speed, since at high-resolutions processing-time is in the same order of magnitude and thus may become the limiting factor. The various OutputCodes ----------------------- I ran several files though ghostscript and recorded the size of the code, the processing time and the printing-time, at least for some of the files. Always the following options were used: "-sDEVICE=stcolor -sPAPERSIZE=a4 stcolor.ps - < file.ps" (Actually "-sPAPERSIZE=a4" is in my gs_init.ps since I'm a germ.) "Softweave" means actually, 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" is just "-dMicroweave", which is equivalent to "ESC . 1 10 10 1", with full skip-optimization and microweave-activated. "deltarow" is the new encoding principle ("ESC . 3 10 10 1") with Microweave on. It is activated with "-sOutputCode=deltarow". Finally I wanted to see the plain Kathy Ireland and used "-sOutputCode=plain", which is just replacing RLE by no encoding, thus "ESC . 0 40 10 15" is used then. [So sorry ;-) Kathy was still blue dressed in front of the blue sea on a blue air-cushion - nice to see but hard to dither] So here are the results: golfer.ps colorcir.ps drawing.ps brief.ps deltarow 572751/48.180u 643374/41.690u 90142/46.180u/1:50 178563/49.350u/2:22 Softweave 559593/46.810u 669966/44.960u 296168/48.160u/1:30 269808/43.320u/1:55 Microweave 590999/56.060u 754276/42.890u 338885/47.060u/1:50 282314/44.690u/2:22 kathy.ps deltarow 3975334/111.940u/5:35 Softweave 3897112/101.940u/3:10 Microweave 4062829/100.990u/3:15 plain/soft 5072255/104.390u/3:05 Evaluation: A.) Might be, that I've not choosen the optimal deltarow-code, but even if it saves at lot of bytes, printing-speed is not increased. B.) At least the printer prefers plain-kathy. In other words: Sending a 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] C.) But "unclever" coding -especially with deltarow- can significantly slows down printing. But even if very significant advantages in the size of the code ar achieved, "deltarow" is not competitive. [colorcir.ps shows savings in deltarow, but printing is a mess.] Printing-Time related to other options -------------------------------------- Full page halftone images printed, unless otherwise noted. DpI print-mode Size Time comments 180x180 mono -/uni 358KB 1:15 -/bi 358KB 0:45 micro/bi 205KB 0:45 (not weaving) soft/bi 179KB 1:25 color -/bi 641KB 2:45 soft/bi 556KB 1:32 360x360 mono -/uni 269KB 0:50 (b/w Text) -/bi 269KB 0:35 (b/w Text) micro/bi 269KB 2:25 (b/w Text) soft/uni 250KB 3:15 (b/w Text) soft/bi 250KB 1:55 (b/w Text) color -/bi 346KB 1:00 (sparse color-page, visible displacements) micro/bi 346KB 1:50 (sparse color-page, looks buggy - printer?) soft/bi 294KB 1:30 (sparse color-page, O.K.) -/bi 2218KB 2:45 (visible stripes) micro/bi 5171KB 3:17 soft/bi 3675KB 3:05 360x720 mono soft/bi 2761KB 5:40 color soft/bi 7789KB 6:15 (just a small difference!) 720x360 color soft/bi 7182KB 5:40 720x720 color micro/bi 14748KB 30:26 (actually beyond printers capabilities) soft/bi 14407KB 11:08 ### ------------------------------ End --------------------------------- ### ### -- The BJC-600/BJC-4000/BJC-70/Stylewriter 2x00, BJC-800 printers -- ### This section was written by Yves Arrouye . HISTORY ------- The BJC-600 driver was written in the first place by Yoshio Kuniyoshi and later modified by me, Yves Arrouye . We both tried to make it evolve synchronously, though Yoshio cannot be reached since a long time. 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. The 2.x release is also the first one to be able to use the full width of an A3 paper size... With the 2.15 release, PostScript Printer Description (PPD) files for the drivers are released. They are not complete at the moment but they can be used to drive the printers' main features. VERSION INFORMATION ------------------- The BJC-600 driver is version 2.17.00 dated 5/23/96. The BJC-800 driver is version 2.17.00 dated 5/23/96. COMPILATION NOTES ----------------- Configuration ------------- * Default values for options and other stuff Configuration for the drivers can be made by modifying defauts 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 given below are defined in this file if you need to change them to customize your installation (a bad idea, better use options...). * CMYK to RGB color conversion By default, the drivers use the same algorithm as Ghostscript to convert CMYK colors to RGB. If you prefer to use Adobe formulaes, define USE_ADOBE_CMYK_RGB when compiling. (See the top of the gdevcdj.c file to see the difference between the two.) * Vertical centering of the printable area 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 BJC_DEFAULT_CENTEREDAREA when compiling, then the top and bottom margins will be the same, resulting in a (smaller) vertically centered imageable area too. * Margins If you define USE_RECOMMENDED_MARGINS then the top and bottom margins will be the same (i.e. BJC_DEFAULT_CENTEREDAREA will be defined for you) and these margins will be those recommended by Canon, 12.4 mm. Because margins are a complicated thing (due to the fact that one does rely on the mechanical precision of the printer), the drivers do something about the bottom margin: by default the bottom margin is 9.54 mm for the bjc600 driver and 7 mm for the bjc800 one. If you define USE_TIGHT_MARGINS then the bottom margin is 7 mm for both drivers (but I never managed to get my own bjc600 print a line on this low bound, hence the greater default). Regardless of the presence of this define, USE_FIXED_MARGINS will not allow the bjc800 to use the lower 7 mm bottom margin, so if you have a problem with the bottom margin on a bjc800, just define that (without defining USE_TIGHT_MARGINS, of course). Compilation ----------- Make sure the bjc600 and/or bjc800 devices are in your DEVICE_DEVS variable. That is look in the makefile for your platform and add them if necessary. This means for example adding them to the DEVICE_DEVS6 variable. The line should read something like that: DEVICE_DEVS6=bj10e.dev bj200.dev bjc600.dev bjc800.dev Now if you get an error from make saying that it does not know how to make bjc800.dev it's because you have an old makefile with only the bjc600 device in it. You then have to copy the lines explaining how to make bjc800.dev in your makefile. These lines are in devs.mak (under the lines for making bjc600.dev) and should go just after the lines for making bjc600.dev. Testing the margins ------------------- A quick way to be sure that the margins you selected (see above) are okay is to print a file whose contents are: %! clippath stroke showpage If the margins are okay, you will obtain a rectangle surrounding the printable area. USE OF THE DRIVERS ------------------ There are two drivers here: the "bjc600" one supports the BJC-600 and BJC-4000 (maybe the BJC-70 as well) and the "bjc800" one supports the BJC-800 series. When remarks here apply to both drivers, the name "bjc" will be used. Supported Options and Defaults ------------------------------ (Note: the names "options", "properties" and "parameters" will be used to designate the same thing: device parameters that you can change.) Preamble: if an option is given an incorrect value, an error will occur. Unless stated otherwise, this error will be a rangecheckerror. Options may be set from the gs command-line (using the -d and -s switches or other predetermined switches if they have an effect on the driver) or using the setpagedevice Level 2 operator if Ghostscript has been compiled with the level2 device (it should ;-)). There are *no* special-purpose operators as one was able to find in Level 1 printers. The default number of bits per pixel for the bjc is 24 (unless you change the value of BJC_BITSPERPIXEL) and corresponds to a CMYK printing. Supported modes are 1 bpp and 4 bpp (gray levels), 8 bpp, 16 bpp, 24 bpp and 32 bpp (colours). Colours are preferrably stored in the CMYK model (which means that with 16 bpp there are only 16 different shades of each color, for example) but it is possible to store them as RGB color for some depths. Some modes do Floyd-Steinberg dithering while some others don't and use the default Ghostscript halftoning (in fact, when halftoning is used dithering takes also place but due to the low point density it is usually not efficient and thus invisible). Here is a short description of each printing mode (expressed in bpp/colors): 32/4 CMYK Colour printing, Floyd-Steinberg dithering. 24/4 Id. (But each primary colour is stored on 6 bits instead of 8.) 24/3 RGB colour printing, Floyd-Steinberg dithering. This mode will *not* use the black cartridge (that's why it exists, for when you don't want to use it ;-)). Each primary colour is stored on 8 bits as in the 32/4 mode, but black generation and under-color removal are done on the driver side and not by Ghostscript so you do not have any control on it. (This mode is not supported anymore on this driver.) 16/4 CMYK colour printing, halftoned by Ghostscript. FS dithering is still visible here (but the halftone patterns are visible too!). 8/4 Id. (But each primary colour is stored on 2 bits instead of 4.) 8/3 RGB colour printing. This mode is not intended to be used. What I mean is that it should be used only if you want to use custom halftone screens *and* the halftoning is broken using the 8/4 mode (some versions of gs have this problem). 8/1 Gray-levels printing, Floyd-Steinberg dithering. 1/1 Gray-levels printing, halftoned by GhostScript. These modes are selected using the BitsPerPixel *and* Colors integers 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 gs as in % gs -sDEVICE=bjc600 gamma.ps myfile.ps where gamma.ps changes the gamma correction (here to 3 for all colors): { 0.45 exp } dup dup currenttransfer setcolortransfer (0.45 being value giving good results for me, your mileage may vary; the bigger the value the lighter the output). The drivers support printing at 90 dpi, 180 dpi and 360 dpi. 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 will also happen if the resolution is not one of those supported. This is not the case as we expect that there may be a 720 dpi bjc someday). Here are the various options supported by the bjc drivers, along with their type, supported values, effect(s) and usage: BitsPerPixel (int) Choose the depth of the page. Valid values are 1, 8, 16, 24 and 32. Default is 24. Note that when this is set for the first time, the Colors property is automatically adjusted unless it is also specified. Defaults adjustments are show in the table below, default choices are indicated by a star (*). This table gives also the corresponding color models and the rendering method that is visible (GS means Ghostscript halftoning, FS Floyd-Steinberg dithering, and if both are present it means that the dithering of halftones is visible). +-----+--------+---+----------+-------+ | Bpp | Colors | * | C. Model | Dith. | +-----+--------+---+----------+-------+ | 32 | 4 | | CMYK | FS | +-----+--------+---+----------+-------+ | 24 | 4 | * | CMYK | FS | | | 3 | | RGB | FS | +-----+--------+---+----------+-------+ | 16 | 4 | | CMYK | GS FS | +-----+--------+---+----------+-------+ | 8 | 4 | * | CMYK | GS | | | 3 | | RGB | GS | | | 1 | | K (CMYK) | FS | +-----+--------+---+----------+-------+ | 1 | 1 | * | K (CMYK) | GS | +-----+--------+---+----------+-------+ Valid Colors values for allowed BitsPerPixel values. Also note that automagical change of one parameter depending on the other one does not work in a setpagedevice call. This means that if you want to change BitsPerPixel to a value whose valid Colors values do not include the actual Colors value, you must change Colors too. Colors (int) Choose the number of color components. Valid values are 1, 3 and 4. Default is 4. This setting cannot be used in a PostScript program, only on Ghostscript's command-line. See ProcessColorModel below for what to use to change the number of colors with PostScript code. Note that setting this property does limit the choices of BitsPerPixel. As for the previous property, its first setting may induce a setting of the "other value" (namely BitsPerPixel, here). Valid combinations are shown in the table below (XX indicates that the combination is valid, ** that this is the default). +--------+------+------------------------+ | | | BitsPerPixel ok values | | Colors | Type +----+----+----+----+----+ | | | 32 | 24 | 16 | 8 | 1 | +--------+------+----+----+----+----+----+ | 4 | CMYK | XX | ** | XX | XX | | | 3 | RGB | | ** | | XX | | | 1 | K | | | | XX | ** | +--------+------+----+----+----+----+----+ Valid BitsPerPixel values for allowed Colors values. Also note that automagical change of one parameter depending on the other one does not work in a setpagedevice call. This means that if you want to change Colors to a value whose valid BitsPerPixel values do not include the actual BitsPerPixel value, you must change BitsPerPixel too. ProcessColorModel (symbol) A symbol taken from /DeviceGray, /DeviceRGB or /DeviceCMYK which can be used to select 1, 3 or 4 colors respectively. Note that this parameter takes precedence over the Colors one, and that both affect the same variable of the driver. (See Colors above for values combined with BitsPerPixel.) HWResolution (floats array) An array of 2 floats giving the horizontal and vertical resolution in dots per inch. Supported values are 90, 180 and 360 and both values must be the same. Default is 360. (On the gs command line, the resolution is changed by saying "-rXDPIxYDPI".) ManualFeed (bool) Indicate that the sheets won't be fed automatically by the printer. Default is false. (Not meaningful on the BJC-600, I fear.) MediaType (string) Choose the media to print on. Values are chose amongst "PlainPaper", "CoatedPaper", "TransparencyFilm", "Envelope", "Card" and "Other". Default is "PlainPaper". If the chose media is "Envelope", "Card" or "Other", the driver will make the printer go in thick mode automatically regardless of the media weight. MediaWeight (int or null) Choose the weight of the media (in g/m2). Using null indicates that the weight is of no importance. Default is null. If the specified media weight is greater than 105 (i.e. the value of the compilation default BJC???_MEDIAWEIGHT_THICKLIMIT) then the printer will be setup to use thick paper. PrintQuality (string) Choose the quality of printing. For the bjc600 driver it can be one of "Normal", "High" and "Draft". For the bjc800 driver it can be one of "Low", "Normal", "High" and "Draft". Default is "Normal" for both drivers. For both drivers, "High" means 200% black and 100% cyan, magenta and yellow (on a bjc600 you will get the "Bk+" light). For the bjc600 driver, "Normal" lits the "HQ" light while "Draft" unlits it. For the bjc800 driver, "Low" has the effect of making only two printing passes instead of four (should be twice as fast ;-)). This is what is known as "CN" (Color Normal) mode. DitheringType (string) Choose a dithering algorithm. Actually the only valid values are "Floyd-Steinberg" and "None". "None" is the default for 1/1 print mode, "Floyd-Steinberg" for other modes. At the moment this parameter is read-only, though no error will be generated if one tries to change it. This parameter is not of much value at the moment and is mainly here to reserve the name for future addition of dithering algorithms. PrintColors (int) Mask for printing color. If 0, use black for any color. Otherwise, the value must be the sum of any of 1 (cyan), 2 (magenta), 4 (yellow) and 8 (black), indicating which colors will be used for printing. When printing colour, only those colour specified will be printed (this means that some planes will be missing). When printing grays, black is used if it is present in the PrintColors; otherwise, the data is printed by superimposing each requested color. MonochromePrint (bool) *For bjc600 only*. Substitute black for Cyan, Magenta and Yellow when printing (useful for getting some monochrome output of a dithered printing for example). Default is false. This is a hardware mechanism as opposed to the previous software one. I think that using this or setting PrintColors to 0 will give the same results. 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 a print, 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 Informations ------------------- Here are other informations published by the driver that you will find in the deviceinfo dictionary: OutputFaceUp (bool) This has the boolean value true, indicating that the sheets are stacked face up. Version (float) In the form M.mmpp where M is the major version, mm the bjc drivers minor version and pp the specific driver minor version (that is, M.mm will always be the same for the bjc600 and bjc800 drivers). VersionString (string) A string that gives the version info plus other indications. At the moment, things like 'a' or 'b' may follow the version to indicate alpha or beta versions and the date of the last change to this version is given in the form MM/DD/YY (no, it won't adapt to your locale!). Hardware Margins ---------------- The BJC printers have top and bottom hardware margins of 3 mm and 7.1 mm respectively (Canon says 7 mm but this is not usable because of the rounding of paper sizes to PostScript points).. The left margin is 3.4 mm for A4 and smaller paper sizes, 6.4 mm for US paper sizes, envelopes and cards. It is 4.0 mm for A3 paper on the BJC-800. The maximum printing width of a BJC-600 printer is 203 mm, in any event. The maximum printing width of a BJC-800 printer is 289 mm on A3 paper, and 203 mm on letter and A4 paper. POSTSCRIPT PRINTER DESCRIPTION FILES ------------------------------------ The BJC600.PPD and BJC800.PPD files (whose long names are, respectively, Canon_BubbleJetColor_600.ppd and Canon_BubbleJetColor_800.ppd) are PPD files driving 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 too 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. Customization of the PPD files ------------------------------ By default the files say that the paper used is US Letter, and they use a normalized transfer function. If you choose to use A4 printing by default, you must replace Letter by A4 in lines that match the '\*Default.*: Letter' pattern. Some versions of Ghostscript have problems with normalized colors, which makes them add magenta in gray levels. If you have this problem, replace the '*DefaultTransfer: Normalized' line by the alternate (correct) '*DefaultTransfer: Null' line. Also note that 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 kept if you get an update of these PPD files. OTHER INFORMATIONS ------------------ Reporting Problems ------------------ When you report a problem please be as descriptive as possible, and please send information that can be used to reproduce the problem. Please don't forget to tell me which driver you use and its version. Version information can be found in this file or preferrably by issuing the following command in a shell: % echo "currentpagedevice /VersionString get ==" | \ gs -q -sDEVICE=bjc600 - (the % doesn't count as part of the command and the device name should be the device you really use). Contact Address --------------- If you have problems with this driver (or if you are extremely satisfied with it) you may email me at Yves.Arrouye@marin.fdn.fr. Acknowledgements ---------------- I am particularly grateful to Yoshio Kuniyoshi without whom I'd never make these drivers and also to Peter L. Deutsch who answered *all* my (often silly) questions about the drivers interface used by Ghostscript. Thanks also to the people who volunteered to beta-test the v2.x BJC drivers; David Gaudine , Robert M. Kenney , James McPherson and Ian Thurlbeck (in an alphabetic listing) 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 for looking at the dithering code and devising a good CMYK dithering algorithm for the Stylus Color, which I then adapted to the code of these drivers. ### ------------------------------ End --------------------------------- ### ### ---------------- MS-Windows DIB printer driver ----------------- ### This section was written by Russell Lang, 4 September 1996 The mswinpr2 device uses MS-Windows printer drivers and should work with any printer with DIB raster capabilities. The printer resolution cannot be selected using PostScript commands from Ghostscript; use the printer setup in the Control Panel instead. If no Windows printer name is specified in -sOutputFile, Ghostscript will prompt for a Windows printer using the standard Print Setup dialog box. You must set the orientation to Portrait, and you must set the page size to that expected by Ghostscript. Failure to do so will result in the image being 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", e.g. -sOutputFile="\\spool\Apple LaserWriter II NT" then Ghostscript will attempt to open the Windows printer without any prompts (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. The following algorithm is used: - If the requested page size matches one of the Windows standard page sizes +/- 2mm, ask for that standard size. - Otherwise if the requested page size matches one of the Windows standard page sizes in landscape mode, ask for that standard size in landscape. - Otherwise ask for the page size by specifying its dimensions only. - If using Windows NT, select a form that matches the page size. (This isn't working at the moment) - Merge the above requests with the defaults. If the printer driver ignores the requested paper size, no error will be generated. It will print on the wrong paper size. - Open the Windows printer with the merged orientation and size. The Ghostscript physical device size will be updated to match the Windows printer physical device. ### ------------------------------ End --------------------------------- ###