This README file contains the following sections: * A General Description of VNMRPlot * VARIAN NMR USER GROUP LIBRARY SUBMISSION FORM * INSTALLATION INSTRUCTIONS and CONFIGURING THE PACKAGE * PRINTER OPTIONS * TABLE OF SUPPORTED PAGE SIZES * A Description of PAGELW * OPERATION of the VNMRPLOT MODIFICATION * MAKING YOUR OWN PRINTER COMMAND FILES * HISTORY OF UPDATES, ADDITIONS, & KNOWN PROBLEMS A General Description of VNMRPlot VNMRPlot: A general system for post-processing VNMR PostScript(R) plot files. FEATURES (includes, but is not limited to): * Supports letter, legal and tabloid page sizes on multi-tray printers from within VNMR. * Supports manual feed on various printers from within VNMR. * Supports variable resolutions (300, 600, 1200 dpi) for HP 4000/5000/8000 printers. * Enables user-chooseable linewidths for plots. VNMRPlot is publicly available at http://nmr.chem.indiana.edu/software.html Authors: Marty Berliner, Marty Pagel email: chemnmr@indiana.edu URL: http://nmr.chem.indiana.edu Address: NMR Facility Department of Chemistry 800 E. Kirkwood Ave. Indiana University, Bloomington, IN 47405-7102 ************************ VARIAN NMR USER GROUP LIBRARY ************************* SUBMISSION FORM Your name: Marty Berliner & Marty Pagel Company/University: Indiana University Address (optional): NMR Facility Department of Chemistry 800 E. Kirkwood Ave. Bloomington, IN 47405-7102 Phone (optional): (812)-855-6492 FAX (optional): (812)-855-8300 E-mail (optional): mberline@indiana.edu mpagel@indiana.edu Date first submitted: 2/11/99 Update submitted : 4/5/99 File name: VNMRPlot.tar Directory: installation may be performed from any directory. Description: A general system for post-processing VNMR PostScript(R) plot files. Related files: many (see below) Existing VNMR files which are superceded or otherwise affected by this submission: /vnmr/bin/vnmrplot Hardware configuration limitations: none Known VNMR version compatibility: 5.2 and up (should also work with VNMR 5.1) Known SunOS version compatibility (if applicable): Solaris 2.5 & 2.6 (should also work with all other SunOS and Solaris versions) Special instructions for installation: "tar -xvf VNMRPlot.tar" then follow the instructions in VNMRPlot/README ******************************************************************************** INSTALLATION INSTRUCTIONS ------------------------- This package consists of several files: README - This file README.config - Printer configuration guide to all printer options. README.PS_AR_11x17 - Example devicetable entry for 11x17 printers install - C-shell script to install all necessary files. bin/pagelw - shell script; performs linewidth modifications on plots. bin/vnmrplot - modification to the VNMR plotting shell script to enable post-processing capability. maclib/pagelw - VNMR macro that calls the pagelw shell script. (A substitute for the VNMR "page" command.) manual/pagelw - Help file for the "pagelw" command. deviceconfig - configuration file for installed plotters that require postprocessing of output files. devicescripts/ - directory containing the PostScript(R) codes necessary for paper tray selection, manual feed selection, and linewidth selection. This installation must be performed as vnmr1 or as root. (1) Log in as vnmr1 or root. (2) Change directories to your new VNMRPlot directory. (3) Type "./install" and follow the directions. (4) Optional step: remove the following files (if they exist): /vnmr/bin/vnmrplot.old /vnmr/bin/pagelw.old /vnmr/manual/pagelw.old /vnmr/maclib/pagelw.old /vnmr/devicescripts.old/ /vnmr/deviceconfig.old These are the old versions of these files & directories before installation of VNMRPlot. (5) Optional Step: edit /vnmr/devicetable and add the PS_AR_11x17 entry if you have a 11x17 Laser Printer. And that's it! CONFIGURING THE PACKAGE ----------------------- All configuration is accomplished by modifying the /vnmr/deviceconfig file. Entries for individual output devices comprise a single line, starting with the queue name for the printer (as defined in /vnmr/devicenames). This name is followed by all the output options for the printer, separated by tabs, and finally a return. Example: ------------------------------------------------------------------------------ # Generic entry list (options separated by tabs) printer_name option_1 option_2 option_3 option_n # For the IU installation, we have a HP 4MV printer with 2 trays # (letter and tabloid) and a Canon Fiery Printer that requires thicker # lines for satisfactory printing. Each 4MV "tray" has it's own queue # and vnmr definition to enable automatic tray selection. sun2lj letter sun2lj_11x17 tabloid color linewidth_3 letter ------------------------------------------------------------------------------ PRINTER OPTIONS --------------- Paper Tray Support: As supplied, this package supports letter (8.5x11 inch), legal (8.5x14 inch) and tabloid (11x17 inch) page sizes for selected popular multi-tray printers. It also allows for changing resolutions on HP 4000/5000/8000 series printers (300/600/1200 dpi). Printer option files are supplied for several common printers; use the table below as a guide for your particular installation. (This table is duplicated in the README.config file.) Linewidth modifications: To change the default linewidth of a device, include a printer option of the form: linewidth_nn where nn is an integer. Recommended values = 1 to 20. Manual Feed: To force VNMR output to the manual feed tray of your laser printer, include the manualfeed printer option. This comes in three forms: If you have a generic PostScript(R) Level 2 printer, use the option: manualfeed If you have a Hewlett-Packard PostScript(R) Level 2 (or emulated) printer, use the following printer option: manualfeed_hp If you have a PostScript(R) Level 1 printer, use the following printer option: manualfeed_level1 TABLE OF SUPPORTED PAGE SIZES ----------------------------- GENERIC TRAY SELECTION COMMANDS work with the following list of printers, and _should_ work with other PostScript(R) Level 2 printers (even those included in other sections of this document). If something down below doesn't work, give these a try. Apple (Color, 16/600, 8500, 360, IIf, IIg, Personal NTR, Pro 600, Pro 630, Pro 810, Select 610) Compaq (PageMarq 15, PageMarq 20) Epson (LP-8200PS2, LP-9000PS2, MJ-5000C, MJ-5100C, MJ-700V2C, MJ-900C, MJ-910C, StylusColor1520, StylusColor3000, StylusColor800, StylusPhoto, StylusPhoto1200, StylusPhoto700, StylusPro5000, PowerRIP for Stylus) Hewlett-Packard (LaserJet 4ML, LaserJet 4M, LaserJet 4Si) Lexmark (Optra N) Use printer options letter legal tabloid (for LW 810, 8500, Compaq 15/20, Epson LP-8200PS2, Stylus...) ********** Hewlett-Packard (Color LaserJet, LaserJet 4M Plus, LaserJet 4MV, LaserJet 5M, LaserJet 5MP, LaserJet 6MP, LaserJet 5Si, LaserJet IIISi, LaserJet 4MP) Use printer options letter_1 legal_1 tabloid_1 (Color LaserJet, 4MV, 5Si) ********** Apple (Personal LW 320) Epson (LP-9200PS2) Hewlett-Packard (Color LaserJet 5M, LaserJet 4000, 5000, 8000) Use printer options letter_2 legal_2 tabloid_2 (LP-9200PS2, Color LaserJet5M, 5000, 8000) FOR 4000,5000,8000 SERIES OF PRINTERS ONLY To change resolution of output, use printer options 300dpi 600dpi 1200dpi ********** Apple (LaserWriter IINT, IINTX) Epson (EPL-7500, LP-3000PS F2, LP-3000PS F5) Hewlett-Packard (LaserJet IIISi, LaserJet IID, LaserJet III, LaserJet IIP) IBM (LaserPrinter 4029, 4039) Use printer options letter_3 legal_3 ********** Apple (LaserWriter Personal NT, Select 310) Use printer options letter_4 legal_4 ********** IBM (Color JetPrinter 4079 PS) Use printer options letter_5 legal_5 tabloid_5 ********** Lexmark (4039 Plus, Optra, Optra C, Optra Color 1200, Optra Color 40, Optra Color 45, Optra EP, Optra K, Optra L series, Optra R series, Optra S series) Use printer options letter_6 legal_6 ********** Canon CLBP 360PS Use printer options letter_7 legal_7 ------------------------------ END OF TABLE ------------------------------- A Description of PAGELW ------ The "pagelw" shell script (located in /vnmr/bin) allows for changing the widths of all lines on a spectral trace. It should be called by the "pagelw" macro (located in /vnmr/maclib). Syntax: macro: pagelw(,) shell script: pagelw linewidth inputfilename Operation: The "pagelw" macro is a replacement for "page". To generate spectral output with thicker lines (spectum, intergrals, scales), issue all usual plotter commands (i.e. pl, pscale, pap, pirn, ppf...) and then conclude the print commands with "pagelw". There are three ways to invoke the "pagelw" macro. (1) Without any arguments In this mode, the pagelw macro will ask the user for the desired linewidth and then send the modified plot to the output device defined in the "plotter" variable. (2) With a linewidth argment In this mode, the syntax is "pagelw(linewidth)" where linewidth is an integer. The macro will then send the modified plot to the output device defined in the "plotter" variable. Example: pagelw(4) will generate a plot with lines 4 pixels wide. (3) With linewidth and plotfilename arguments. In this mode, the syntax of the command is "pagelw(linewidth,'plotfilename')", where linewidth is an integer and plotfilename is a valid UNIX filename. The macro will write the modified plot file to 'plotfilename' in the current directory and will _not_ generate any printed output. Use this form of the command when an EPS file is required for import into another program or for distilling to a PDF file. Example: pagelw(5,'wideline.eps') will generate a file named "wideline.eps" that contains the PostScript commands to generate a plot with lines five pixels wide. This plot file can be imported into any program that supports EPS files, and can be distilled to a PDF file with Adobe Acrobat Distiller or GhostScript. OPERATION of the VNMRPLOT MODIFICATION -------------------------------------- Once installed, the package is completely user transparent. For purposes of additional user modification, the operation of the shell script is described here in more detail. The majority of the action occurs within a modification of the VNMRPLOT shell script, which is listed below (lines numbered for clarity). ------------------------------------------------------------------------------- [1] if [ $# -eq 2 ] # Only operate of files destined for the printer [2] then [3] awkstring='{for (i=2; i<=NF; ++i) print "'$vnmrsystem'/devicescripts/"$i" "}' [4] optionstring=`grep -w $2 $vnmrsystem/deviceconfig | awk "$awkstring" ` [5] linewidth=`echo $optionstring | nawk -F"[/_ \t]" '{for (i=1;i<=NF;i++) if ($i=="linewidth") print $(i+1) }'` [6] endprolog=`awk '{ if ($0 == "%%EndProlog") print NR; }' $1` [7] if [ ${optionstring} ] [8] then [9] mv $1 $1.tmp [10] head -$endprolog $1.tmp | cat -s - $optionstring > $1 [11] endprolog=`expr $endprolog + 1` [12] tail +$endprolog $1.tmp >> $1 [13] \rm $1.tmp [14] fi [15] if [ "$linewidth" ] [16] then [17] pagelw $linewidth $1 [18] fi [19] fi -------------------------------------------------------------------------- Line Number Action ------------- ---------------------------------------------------------- [1]-[2] VNMRPLOT is given two arguments ($1=plotter file, $2=plotter) when the output will be going to a plotter. Three arguments are supplied when the file will be written to disk ($3=output file). We only want to operate on files destined to be printed, since we assume that users saving PostScript(R) output will want the files for inclusion into documents or for distilling to PDF files, for which our modifications are unnecessary. [3]-[4] Build a string variable containg an "awk" command that will collect printer options from the devicescripts file. We need to use a string to properly include the value of the $vnmrsystem shell variable, which contains the path to the vnmr directory (usually /vnmr). The output of this command ("optionstring") will be a listing of the absolute path to files containing the text of all the printer options. [5] This line parses the printer options for a linewidth operator (linewidth_##), and then it executes a nawk script that extracts that number and stores it in the "linewidth" variable. [6] Find the line in the PostScript(R) output file where we should insert the plotter options (after the prolog). [7]-[14] If there are options to include for this printer, then stitch them into the plot file. This is done with the following steps: (1) Move the original plot file ($1) to a temporary file ($1.tmp) (2) Take the header of $1.tmp and cat it to a list of all the options, redirecting the output back to $1. (3) Take the rest of the original plot file (from $1.tmp) and append it to $1, which contains the original prolog and all our options. (4) Delete the temporary file. [15]-[19] If we need to adjust the linewidth of the plot, call the "pagelw" script to do the adjustment. The final output of this code is just a modified plot file, so we finish by executing the rest of the vnmrplot script as usual! MAKING YOUR OWN PRINTER COMMAND FILES ------------------------------------- All the printer codes are taken from the publically-available PostScript Printer Definition (PPD) files that are supplied with the drivers for individual printers. They are also available at the web sites of printer manufacturers. To create your own page selection command file, search the PPD file for a list of the supported paper sizes (media sizes) of your printer. This is usually in a section called "Media Selection"; a listing from the PPD file for the Hewlett-Packard LaserJet 4MV printer is included below: --------------- HP LASJERJET 4MV PPD FILE PARTIAL LIST --------------------- *% =================================== *% Media Selection *% =================================== *LandscapeOrientation: Plus90 *VariablePaperSize: False *% Page Selection by size *OpenUI *PageSize: PickOne *OrderDependency: 30 AnySetup *PageSize *DefaultPageSize: Letter *PageSize Letter/US Letter: " <> setpagedevice" *End *PageSize LetterSmall/US Letter (Small): " <> setpagedevice" *End *PageSize Executive/Executive: " <> setpagedevice" *End *PageSize Legal/US Legal: " <> setpagedevice" *End *PageSize LegalSmall/US Legal (Small): " <> setpagedevice" *End *PageSize Tabloid/11x17: " <> setpagedevice" *End *PageSize Tabloid.2/11x17 (Oversize): " <> setpagedevice" *End *PageSize A4/A4: " <> setpagedevice" *End *PageSize A4Small/A4 (Small): " <> setpagedevice" *End *PageSize A3/A3: " <> setpagedevice" *End *PageSize B4/JIS B4: " <> setpagedevice" *End *PageSize B5/JIS B5: " <> setpagedevice" *End *PageSize Comm10/Env Comm10: " <> setpagedevice" *End *PageSize Monarch/Env Monarch: " <> setpagedevice" *End *PageSize DL/Env DL: " <> setpagedevice" *End *PageSize C5/Env C5: " <> setpagedevice" *End *PageSize EnvB5/Env ISO B5: " <> setpagedevice" *End --------------------------------- END OF LIST ------------------------------ To make your own page tray command file, find the paper size that you wish to support (i.e. for A3 paper, look for "*PageSize A3/A3: ..."). Take the text in the quotes and copy it to a new file with a descriptive name (i.e. A3). In this instance, the text you will need to place in the A3 file is: <> setpagedevice To use this page command file, three more steps are required: (1) Copy this file (i.e. A3) to the /vnmr/devicescripts directory. (2) Edit the /vnmr/deviceconfig file to include this option for your printer. (3) Create a new entry in /vnmr/devicetable for this output device (so that new plots will utilize the entire printable area on the page). We have supplied a devicetable entry for 11x17 page size (600 dpi) as a guide for further modification. HISTORY OF UPDATES, ADDITIONS, & KNOWN PROBLEMS ----------------------------------------------- 02/11/99 VNMRPlot tested and packaged. VNMRPlot is made available via the IU NMR Facility web site and sent to Rolf Kyburz at Varian for consideration as a userlib entry. 02/12/99 A customized addition used in the IUNMR Facility to log printer requests was removed from /vnmr/bin/vnmrplot. 02/24/99 "VNMRPlot" becomes the current official name of this package. The original name was "BerlinerPlot". 02/24/99 Extra notes and other information added to the README file. 04/05/99 A minor problem that causes /vnmr/bin/pagelw to fail if called twice by the other routines has been fixed. 04/05/99 Minor administrative updates were made to the README file.