xwinplot files

Julian Keates (julian@nmr400a.mols.susx.ac.uk)
Fri, 29 Nov 1996 10:16:20 +0000

>From julian Fri Nov 29 10:09:04 1996
From: "Julian Keates" <julian@nmr400a.mols.susx.ac.uk>
Message-Id: <9611291009.ZM8719@nmr400a.mols.susx.ac.uk>
Date: Fri, 29 Nov 1996 10:09:04 +0000
Return-Receipt-To: "Julian Keates" <julian@nmr400a.mols.susx.ac.uk>
In-Reply-To: Stefan Berger <BERGER@ps1515.chemie.uni-marburg.de>
"xwinplot files" (Nov 28, 5:18pm)
References: <19A37F5F1B@ps1515.chemie.uni-marburg.de>
X-Mailer: Z-Mail (3.2.2 10apr95 MediaMail)
To: berger@ps1515.chemie.uni-marburg.de
Subject: Re: xwinplot files
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Status: OR

On Nov 28, 5:18pm, Stefan Berger wrote:
> Subject: xwinplot files
> Dear BUMers,
>
>
> In the old days, we plotted spectra in Xwinnmr using hp_A4 as the
> printer-plotter, created with this option an hpgl file, transferred this to
> any wordprocessor, converted it with the appropriate hpgl filter,
> annotated it and printed within the report.
> When one uses the more advanced Xwinplot, this option is apparently
> not more available. By printing to a file, a postscript file is created.
> Does anyone know, how to integrate and/or convert this postscript
> file into a report using textprograms like winword 7.0 or others? The
> filter for encapsulated postscript offered by winword does not work.
>
> stb
-- End of excerpt from Stefan Berger

Dear Stefan,

It's (relatively) easy. The conversion is achieved using ghostscript. It comes
with a file called 'ps2hpgl.ps'. This is in /u/xspec/ghostscript and comes as
standard with xwinnmr releases. The file contains postscript commands and must
be used as part of the ghostscript command line. To make this easier, we use it
in a unix shell script (called ps2hpgl in /usr/local/bin):

------ BEGIN FILE ps2hpgl -----
#!/bin/sh

if [ $# -lt 1 -o $# -gt 2 ]; then
echo "Usage: pstohpgl file.ps [file.hpgl]" 1>&2
exit 1
fi

infile=$1

if [ $# -eq 1 ]
then
case "${infile}" in
*.ps) base=`basename ${infile} .ps` ;;
*.cps) base=`basename ${infile} .cps` ;;
*.eps) base=`basename ${infile} .eps` ;;
*.epsf) base=`basename ${infile} .epsf` ;;
*) base=`basename ${infile}` ;;
esac
outfile=${base}.hpgl
else
outfile=$2
fi
export outfile

/u/xspec/bin/gs -q -I/u/xspec/ghostscript -I/u/xspec/ghostscript/fonts
-dNOPAUSE /u/xspec/ghostscript/ps2hpgl.ps ${infile} 1>&2 >> ${outfile}

exit 0

----- END FILE ----

This is run with the command:

ps2hpgl myfile.ps myfile.hpgl

In addition, you'll (sometimes) need to type 'quit' after entering this command
to terminate ghostscript.

We use this method regularly. Although large, the hpgl files load perfectly
into
word 6 and 7 and are fully scalable, without sacrificing resolution.

Hope this helps.

Julian Keates.

-- 
----------------------------------------------------------------------
|                                                                    |
| Julian Keates                                                      |
| MOLS P/G P/H                                                       |
| The Chemistry Laboratory                                           |
| University of Sussex, Falmer, Brighton, BN1 9QJ.                   |
|                                                                    |
| E-mail:  julian@nmr400a.mols.susx.ac.uk or                         |
|          J.M.Keates@sussex.ac.uk                                   |
|                                                                    |
| W3:    http://nmr400a.mols.susx.ac.uk/~julian                      |
|                                                                    |
----------------------------------------------------------------------