09-10-2001 IBM's Omni Driver Model for Ghostscript Printing - version 0.4.3 ================================================================= IMPORTANT NOTE: We have changed the layout of where the printer drivers are to be kept. The code has been changed to load the printer drivers .so files out of the /opt/Omni/bin directory. When building Omni please move the files to that directory to insure that they will be loaded correctly or else ensure the LD_LIBRARY_PATH is set as explained below. NOTE: We no longer place patch files in the root of the tar file because there are now multiple versions of the Ghostscript patches. Please look under Omni/Ghostscript and choose the proper version based on the source that you are using. If your have previously installed the second release of the Omni driver, the directories have changed and you should delete the entire Omni tree from your Ghostscript directory before unpacking this release. Please backup any file changes you have made as there are a number of core files that have been added or updated in this release. We have also enabled faster driver development with the ability to easily extend the existing device support with features of a new device through a well defined pluggable interface. Additionally, The Omni driver supports the dynamic loading of new device support. Once you have build this package with Ghostscript, printer drivers can be built separately and applied to a system without having to rebuild Ghostscript on the target systems. Accurate per device printer features are supported through command line options allowing the user to change multiple properties of the completed output. We have also provided a utility for querying the available options on a particular device. We will continue to improve upon this code by adding new function and features. Since the driver model and code are not 100% completed yet, we welcome any feedback concerning the driver/driver model along with any problems or issues that might arise during its use. We also would like to have any contributions that will increase the stability, performance, or feature set of the Omni driver. We have not tuned the color output on all devices. If your output colors are not correct, please refer to section 5 (Omni color adjustment) to adjust the gammas to best suit your printer, paper, and inks. The remainder of this readme describes: - how and where to download the source from - how to structure and build Ghostscript and the Omni driver - how to use Ghostscript with the Omni driver Fixes/Updates ============= Version Date 0.4.3 - 09-05-2001 - Corrected issue with zip package. The updated DeviceMedia.cpp and DeviceMedia.hpp for Foomatic support have been updated to match the CVS Repository. Also corrected the latest Ghostscript 6.51 patches. 0.4.2 - 09-01-2001 - Added support for foomatic under printconf. The files are under the Omni/Foomatic directory that allows the use of the Omni driver under the latest versions of printconf. 0.4.1 - 08-29-2001 - Resolved several issues with the starting page position on Epson Stylus Photo printers. - Updated the Ghostscript 6.51 patches - Moved the default path for the Omni drivers to the /opt/Omni/bin directory This makes setting the LD_LIBRARY_PATH optional 0.4.0 - 08-17-2001 - Added 21 new Hewlett Packard LaserJets to the omni driver! - Added an internal resolution to the DeviceResolution class so that a printer that can support hardware scaling could be implemented. - Added compressing RGB data to GplCompression. - Moved the GplpGenerateGammaCurve function in GplDitherInstance to public. - Converted the Steinburg algorithm from integer math to floating point math. Added 6 color support and multi-bit support to the Steinburg algorithm. - Added %f to PrintDevice::sendPrintfToDevice. - Fixed bug in DeviceDither::getDitherCatagory. - Updated Epson Stylus Photo 870, 875DC, & 1270 for 4 color support. Resolved problems printed at 360 dpi in 4 colors on the 870 & 875DC. - A lot more work was done for UPDF support. - Added Device::getShortName () which returns the name of the file (minus the lib and .so parts). - Added DeviceXXX::getName (id) which returns the NLV translated name for a form (without creating a new form object and querying that object). For the following classes: Form, Tray, Media, PrintMode, Resolution, and Orientation. - Added DeviceXXX::isXXXSupported (id) that will query if an id is supported for that device without having to create a new object of that id. For the following classes: Form, Tray, Media, PrintMode, Resolution, and Orientation. - Added prototype Foomatic support. 0.3.1 - 06-19-2001 - Fixed build break in Canon BJC-8500 Blitter.cpp. - Fixed build break in tools directory. 0.3.0 - 06-13-2001 - Changed the way to create a new dither instance to allow for future growth/other dither packages. - Fixed FORM_LEDGER's size to be 17x11 to conform with Ghostscript. Thanks to phallobst@web.de for spotting that. - Added 10 new Medias to encompass the PWG's UPDF format. - Added initial code to handle a UPDF device XML. Look at tools/UPDF. - Switched from dlopen to glib's version. 0.2.0 - 05-09-2001 - make clean before building! - Added first implementation of the proposed inkjet architecture (IJS). Added a new parameter to Ghostscript to switch into this mode. Add -sserver=<output_file> to the command line. Remove the -sOutputFile=<output_file> if there is one. This command line option (-sOutputFile) is not used in conjunction with IJS. NOTE: The root directory (where the omni executable is) must be in the PATH! - Added the ability to call beginJob () with new job properties. This allows for the creation of a device, displaying job properties dialog, and setting the new job properties for the print job. - Included 25 more Epson devices that were not being compiled. Thanks to phallobst@web.de for spotting that one. - Added DeviceOrientation class to the omni driver. - Fixed form margin information which were not rescaled to thousands of a mm. 0.1.2 - 04-27-2001 - Fixed a bug in omni's newFrame logic for each device class. 0.1.1 - 04-26-2001 - Fixed Ghostscript not finding required entry points in libomni.so. - Added new feature to Ghostscript that allows the user to choose between Ghostscript's dithering from color to monochrome and our dithering. The default is to use our dithering. To use Ghostscript's add the following to the command line: -smonodither=GSMONO Currently, Ghostscript's dither routines are faster but less smoothing than Omni. 0.1.0 - 04-24-2001 - Fixed some Ghostscript issues with returning failures when devices are not initialized properly with invalid command line options. 0.0.9 - 04-17-2001 - Renamed OmniInterface.* to GhostscriptInterface.* (more descriptive). - Made changes to DeviceForm.* and HardCopyCap.cpp to standardize forms. - filled in missing sizes - slightly changed some sizes to match with the standard - removed FORM_11_X_17 (duplicate of FORM_LEDGER) - removed FORM_INDEX_CARD (not used and confusing) - removed FORM_B5_ENVELOPE (not used and nonexistant) - removed FORM_A6_INDEX (not used and nonexistant) - removed FORM_LEGAL_WIDE (not used and nonexistant) - removed FORM_TABLOID_WIDE (not used and nonexistant) - removed FORM_A5_WIDE (not used and nonexistant) - removed FORM_B4_WIDE (not used and nonexistant) - removed FORM_B5_WIDE (not used and nonexistant) - removed FORM_QUARTO_WIDE (not used and nonexistant) - added 75 new forms to begin to merge with PWG's Media Standard Names - moved form sizes from HardCopyCap.cpp to DeviceForm.cpp - Increased HardCopyCap's units to thousands of a millimeter (1/1000 mm) to avoid conversion problems to thousands of an inch (1/1000 inch). Ex: 4.125 * 2540 = 10477.5 - Fixed Ghostscript code to call Omni with beginJob/newFrame/endJob instead of beginJob/endJob/beginJob/endJob for multiple page jobs. - Introduced test subdirectory. 0.0.8.2 - 04-10-2001 - Fixed build break in MonoDither.hpp - Fixed "DeviceTester::createDevice: dlerror returns Epson/libEpson_Stylus_Photo_870.so: undefined symbol: getJobProperty__29Epson_High_Res_ESCP2_InstancePc" when run against Epson devices with high resolutions (Ex: Epson Photo 870). - Fixed several Ghostscript reported problems. 0.0.8.1 - 04-06-2001 - Forgot to move the 24-1 monochrome dithering routine into core omni code. 0.0.8 - 04-05-2001 - added a new device job property for Epson class devices (and their compatible printers as well). It controls the bidirectional movement of the print head. To turn it off add bidirectional=0 to the job properties and to turn it on add bidirectional=1. - Fixed trap in Epson Stylus Color 740. Fixed incorrect output in Epson Stylus Color 740. - Changed the ghostscript interface to use synchronous instead of asynchronous mode. - Added error output if file did not exist for XMLParser. 0.0.7.5 - 03-23-2001 - added a new option to Ghostscript. It is -dPelSizeCorrection=xxx where xxx is a number. If you are printing black & white line art images then use 0 for no pel removal. Otherwise, leave it alone. It is for advanced usage. - added listDeviceJobPropertyKeys () to the Device class. This will return an enumeration that lists all of the device dependent job properties that are supported. - Fixed binary data error handling in OmniDomParser.cpp. 0.0.7.4 - 03-15-2001 - Fixed page sizes longer than Letter in Epson class devices. - Fixed memory leak in libxml version of OmniDomParser.cpp. 0.0.7.3 - 03-09-2001 - Changed form sizes for the Okidata ML-320 Turbo. - Added error condition in XMLParser. - Added new resolutions. 0.0.7.2 - 03-05-2001 - Fixed a trap where no dither job property was specified. - Changed naming convention from patch.xxx to Omni.patch.xxx.yyy. 0.0.7.1 - 03-02-2001 - Changed the input parameters for the driver's job properties. Previously you would type in each of the driver parameters as a separate parameter. The current code now requires you to input just one properties string. Example: Previously - -smedia=MEDIA_SPECIAL_720 -sresolution=RESOLUTION_720_X_720 this would have been two strings using the -s Now - -sproperties="media=MEDIA_SPECIAL_720 resolution=RESOLUTION_720_X_720" this will use one key parameter, properties, and the parameters following it will be enclosed in quotes. - Resolved some problems with printing green colors and gradients to lighter colors would come out incorrect. - Resolved some problems with the patching of the core Ghostscript files 0.0.7.0 - 02-23-2001 - Created interface for Ghostscript to do dynamic loading for devices - Resolved several problems with Canon support - Provided initial release of an interface for GNOME - Initial "prototype" for CUPS support (not completed) - DeviceTester has the ability to draw a box that can help fine tune the printable area on a printer. The box can be adjusted so that the overall printable area can be evaluated and put back in the proper devices xxx_Forms.xml file. Please provide us updated info. if our values are incorrect. - DeviceTester has the ability to draw colors. This will allow you to fine tune your gammas based on the paper type and inks you are using. - Added the ability to pass in a job property to enable debugging on: DeviceBlitter DeviceDither DeviceInstance DevicePrintMode DeviceTester DeviceTester6 GplCompression GplDitherInstance Omni OmniInterface OmniProxy PrintDevice Blitter Instance All This will allow applications, such as DeviceTester, to pass in a new parameter i.e. debugoutput=DeviceBlitter (one of the above) when invoking the driver. IMPORTANT NOTE: Please refer to the section on applying patches to Ghostscript. We have updated our patching scheme and we include both full and partial patch updates for Ghostscript. 0.0.6.2 - 02-07-2001 - Provided additional support Epson Photo printers - Some additional fixes to the color support - Resolved problems with six color plane management and compile time problems. 0.0.6.1 - 01-30-2001 - Provided support for six color Epson Photo printers - Additional changes for dithering implementation - Some additional fixes 0.0.5.1 - 01-09-2001 - Allow the use of different XML parsers. We provide the ability to use either the xerces, libxml, and xml4c3 parsing libraries. - Give the ability to load different dithering routines. We provide an example file - DitherLibraryExample.cpp in the Omni directory. This file shows what code needs to be changed to implement the new dither and what files will need to be added. Please refer to this file. 0.0.5.0 - 12-15-2000 - Added support for over 100 additional devices. These devices are from Canon, Okidata, Panasonic, and Star. - Altered some of the defined values to allow the tagging for XML to be more appropriate. - Additional changes to the RGB->CMYK conversion. 0.0.4.3 - 12-01-2000 - Made some additional changes to the Stucki dithering code increase performance some for Epson High Resolution Devices. - Updated startpage information for Epson High Resolution Devices. 0.0.4.2 - 11-30-2000 - Resolved some issues with the patch data - Made some additional changesto the Stucki dithering code to smooth transitions between lighter and darker colors for better skin tones. 0.0.4.1 - 11-15-2000 - Adjusted the start page procedures on Epson High Res devices - Resolved some issues with printing 1440x720 using monochrome - Made some minor changes to the Stucki dithering code to allow for better detail 0.0.4.0 - 11-02-2000 - Implemented higher quality Epson print modes - Modified CMYK conversion to yield brighter output - Additional changes and updates to the core code 0.0.3.1 & 0.0.3.2 - 10-17-2000 - Changed the management of bitmap ordering and positioning - Resolved problem in XML parser 0.0.3 - 10-06-2000 - Removed dependency on Java in favor of XML 0.0.2 - 8-21-2000 - Resolved problem with printing monochrome postscript files. - Changed naming convention from patch.xxx to Omni.patch.xxx. 1. Build Components Needed ======================= 1.1 Current version of GNU Ghostscript 5.50 Licensing: http://www.cs.wisc.edu/~ghost/gnu/index.html Download Ghostscript required files for the ability of building the ghostscript executable Download: ftp://ftp.cs.wisc.edu/ghost/gnu/gs550/ gnu-gs-5.50.tar.gz gnu-gs-5.50jpeg.tar.gz gnu-gs-5.50libpng.tar.gz gnu-gs-5.50zlib.tar.gz referenced from: http://www.cs.wisc.edu/~ghost/gnu/gnu550.html Additional components that need to be downloaded to enable support of the Omni driver in Ghostscript. 1.2 XML Parser - download and install one of the following parser libraries Download one of the prebuilt packages from the following sites. In our current directory configuration, we have three different sub-directories under the XMLParser directory that contain the version specific XML parsing code to match the downloaded version. When you decide which XML code to use, you will need to move the code that is contained under the XMLParser sub-directory for that version of XML to the next higher level (XMLParser directory). Make the appropriate changes to XMLParser/Makefile: XML_DIRECTORY - Set to the directory where your XML parser is installed OMNI_INCLUDE_PATH - Set to ".." if you have copied the makefile from a lower level directory OMNI_LIB_PATH - Set to ".." if you have copied the makefile from a lower level directory Make the appropriate changes to setit: LD_LIBRARY_PATH - Change to the directory where your XML parser is installed Make the appropriate changes to common.mak: XML_DIRECTORY - Set to the directory where your XML parser is installed 1.2.1 Xerces C++ XML Parser http://xml.apache.org/xerces-c/index.html example xerces-c1_3_0-linux.tar.gz 1.2.2 XML4C http://www.alphaworks.ibm.com/tech/xml4c example xml4c3_1_0-linux.tar.gz 1.2.3 libxml http://xmlsoft.org/ example libxml-1.8.6-2.i386.rpm libxml-devel-1.8.6-2.i386.rpm You *must* install the developers version of libxml (in this case libxml-devel-1.8.6-2.i386.rpm) because that version contains the include files required by Omni's XML parser. 1.3 glib Download and install the latest development version of glib located at ftp://ftp.gtk.org/pub/gtk/ if it is not already installed on your system. 1.4 Debugging Tools ** The following two items are optional. They can be very useful if code debugging is necessary to resolve a problem. 1.4.1 DDD debugger Go to http://www.redhat.com/swr/i386/ddd-3.2-4.i386.html. This will bring you to the download page for DDD debugger interface. Select download and you will be brought to a page to allow down- loading of the package for instance: ftp://ftp.sourceforge.net/pub/mirrors/redhat/redhat/powertools/6.2/i386/i386/ddd-3.2-4.i386.rpm 1.4.2 Lesstif libraries Go to http://www.redhat.com/swr/i386/lesstif-1.2-devel-0.89.9-2.i386.html and select download of the package from one of the available sites. ftp://ftp.sourceforge.net/pub/mirrors/redhat/redhat/powertools/6.2/i386/i386/lesstif-1.2-devel-0.89.9-2.i386.rpm 2. Installation ============ NOTE: These commands assume that you use the proper paths for copying/unziping Ex: the files are located in /tmp Install Ghostscript extract ghostscript cd / tar -xvzf /tmp/gnu-gs-5.50.tar.gz change to that directory cd gs5.50 extract the 3rd party source files tar -xvzf /tmp/gnu-gs-5.50jpeg.tar.gz mv jpeg-6b jpeg tar -xvzf /tmp/gnu-gs-5.50libpng.tar.gz mv libpng-1.0.2 libpng tar -xvzf /tmp/gnu-gs-5.50zlib.tar.gz mv zlib-1.1.3 zlib link X11 cd /usr ln -s X11R6 X11 cd /gs5.50 make sure that you can build what you just installed ln -s unix-gcc.mak Makefile make make debug Make a directory under your Ghostscript source directory and go there. mkdir Omni Unzip the current Omni source from the gs5.50 directory tar -xvzf /tmp/Omnixxx.zip (where xxx denotes level) Make sure that you can build what you just installed cd Omni make After making the files, validate that there are .so files in both the Omni directory and all of the device directories (Epson, Brother, Panasonic, Star, Okidata, IBM). Note: To build a subset of the full omni build, edit the following files: Makefile - modify SUBDIRSLIST to include only the driver directories that you are interested in building (including XMLParser of course). (driver)/Device List - comment out the devices that you are not interested in generating by having '#' be the first character of the line. (driver)/Makefile - comment out the line under the postdevice target where it calls make on each .mak file. Insead, as an example, use the following: make -f Epson_LQ_2550.mak Apply patches to Ghostscript (patch file name is Omni.patch.xxx.yyy) - where xxx denotes the date or level of patch and yyy denotes clean or update patch < Omni.patch.xxx.yyy cd .. Omni.patch.082100.clean is meant to be used on a pure ghostscript directory. Omni.patch.113000.update is meant to be used after Omni.patch.082100.clean is applied. Omni.patch.022001.update is used to update previous patches. Omni.patch.022001.clean is used to do a full update to ghostscript with no previous patches applied. Build the final product. cd /gs5.50 make clean make << "make debug" for debug embedded code>> Install graphical debugger (optional) cd /tmp rpm -i lesstif-0.90.0-1.i386.rpm rpm -i ddd-3.2-4.i386.rpm 3. Ghostscript/Omni Commands ========================= Make sure that you are running the new ghostscript that you just built. Make sure that the LD_LIBRARY_PATH environment variable is set up and correct. For example, execute the setit command in the Omni directory: . ./setit The following command line options are mandatory when invoking Ghostscript and using the omni print filter. - device: -sDEVICE=omni - printer: -sDeviceName=xxxxxx Note: The device name is one of the printer types contained in the omni filter. For example, Epson_Stylus_Color_860. All other values for the filter can set to predefined defaults in the printer filter. The following are examples of options that can change for each job. - form: form=FORM_LETTER or form=FORM_A4 - resolution: resolution=RESOLUTION_360_X_360 or resolution=RESOLUTION_180_X_180 - media: media=MEDIA_PLAIN or media=MEDIA_GLOSSY - dithering: dithering=DITHER_STUCKI_DIFFUSION or dithering=DITHER_STEINBERG_DIFFUSION - tray: tray=TRAY_MANUAL_FEEDER - printmode: printmode=PRINT_MODE_1_ANY (**) or printmode=PRINT_MODE_24_CMYK **This value is needed when you want to generate monochrome output instead of 24bit color. Use the DeviceTester2 program to discover what options are available for your printer. For example, DeviceTester2 Epson_Stylus_Color_860 These options are then combined and put on the command line as follows: -sproperties="form=FORM_A4 media=MEDIA_PLAIN printmode=PRINT_MODE_1_ANY" NOTE: When changing the form size within the omni device, you will need to also set corresponding PAPERSIZE in Ghostscript using the -sPAPERSIZE parameter or the over-ride -g parameters (documented in Ghostscript). 5. Omni color adjustment ===================== We have not verified the color correctness on every device. If you find that the color output on your device is not correct, The color output can be adjusted by changing each of the gammas in the gamma file for the particular device you are using. Before you can change the correct gamma you must first be able to identify each of the following: - printer model - type of dither method applied - matrix or diffusion - printing mode, be it mono, 8, or 24 bit black/black and color - media type If you are working with the Epson Stylus Color 860 you can change the file "Epson Stylus 860 Gammas". The structure defining each of the values in the file are contained in DeviceGammas.hpp. The gamma value can be changed along with the bias value, minimum value needed for each color. Raising any of these values will deplete the color that has been changed. Since the Omni driver supports separate per color plane corrections for each media type, print mode, resolution, and dither mode combination you must modify the line representing your current print options. 6. Adding a Device =============== see file Omni/docs/HowToCreateADevice 7. Reporting bugs ============== Send mail to linuxprt@us.ibm.com Please tell us the the following things in your note: - the version of Omni that you are using - the program (and version) that you are using as well as the parameters on the command line. - a debug stack trace. For example, the DeviceTester program traps. $ ../DeviceTester drawbox driver libCanon_BJC_2000.so cout output24.prn cerr output24.err printmode PRINT_MODE_24_CMYK scanlines 2048 Segmentation fault (core dumped) $ gdb ../DeviceTester GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux"... (gdb) run drawbox driver libCanon_BJC_2000.so cout output24.prn cerr output24.err printmode PRINT_MODE_24_CMYK scanlines 2048 Starting program: /gs5.50/Omni/Omni.C++/Canon/../DeviceTester drawbox driver libCanon_BJC_2000.so cout output24.prn cerr output24.err printmode PRINT_MODE_24_CMYK scanlines 2048 Program received signal SIGSEGV, Segmentation fault. 0x4003a469 in GplCompressChooseMode (pbRow=0x0, pbLastRow=0x0, iRowLength=360, iCompressModes=2, pDelta=0x8053408) at GplCompression.cpp:2250 2250 if (*(pbRow + i) == *(pbRow + i - 1)) // for TIFF testing (gdb) bt #0 0x4003a469 in GplCompressChooseMode (pbRow=0x0, pbLastRow=0x0, iRowLength=360, iCompressModes=2, pDelta=0x8053408) at GplCompression.cpp:2250 #1 0x40037c9b in GplCompression::compressRasterPlane (this=0x80530d8, pbBuffer=0x0, iPrinterBytesInArray=360, pbLastLine=0x0, pbCompress=0x8053130 "\202ÿ\202ÿ\227ÿ", cbCompressBuffer=720, iCompressModeSupported=2, pDelta=0x8053408, iWhichPlane=3) at GplCompression.cpp:338 #2 0x40037a2d in GplCompression::compressKRasterPlane (this=0x80530d8, pbdKPlaneIn=0x8054a00) at GplCompression.cpp:239 #3 0x4002c503 in DeviceBlitter::compressKRasterPlane (this=0x8052238, pbdKPlane=0x8054a00) at DeviceBlitter.cpp:341 #4 0x401f9c28 in Canon_Blitter::canonColorRasterize () from /gs5.50/Omni/Omni.C++/Canon/libCanon_BJC_2000.so #5 0x401f8736 in Canon_Blitter::rasterize () from /gs5.50/Omni/Omni.C++/Canon/libCanon_BJC_2000.so #6 0x400341b5 in PrintDevice::rasterize (this=0x8052188, pbBits=0x40235008 "", pbmi2=0x8054c50, prectlPageLocation=0xbffff818, eType=BITBLT_BITMAP) at PrintDevice.cpp:827 #7 0x804dc8e in drawPage (iMaxScanLines=2048, pDevice=0x8052188, fDrawBox=true, fDrawColors=false) at DeviceTester.cpp:1559 #8 0x804ec76 in main (argc=12, argv=0xbffff934) at DeviceTester.cpp:1883 (gdb) quit The program is running. Exit anyway? (y or n) y 8. Issues, future function and to-do's =================================== - Additional clean up of code - Fix all color dithering algorithms to use a consistent color space conversion. - Add device specific color dithering algorithms. - Implement Ghostscript banding in the Ghostscript render and out of core Omni. - performance improvements - Add support for additional input bitmap support. Currently there is only support for mono and 24bpp output. - Copies function to be added - Stucki Diffusion (default dither) provides the best quality output at this point in time. Using a high quality coated paper should be used when printing high quality image output. Some of the other dithering code that needs completion are: Steinberg Level Smooth HSV Ordered Square Void Cluster 9. Know problems ============= - Several of the dithering functions do not work at this point in time. We are changing them and resolving issues with inconsistancies between them i.e. magic square or ordered square dithers will produce black output. - Some of the devices may require modifications to the page size and printable areas. - Some of the devices may require modifications to the color correction data. - Additional work to be done on the color and dithering implementation. - Gamma values may need to be tweaked for some of the Epson Photo devices such as the 870 and 1270.