home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / psutils / part01 next >
Encoding:
Text File  |  1993-09-20  |  60.2 KB  |  2,193 lines

  1. Newsgroups: comp.sources.misc
  2. From: ajcd@dcs.ed.ac.uk (Angus Duggan)
  3. Subject: v39i093:  psutils - Postscript document manipulation tools, v1.12, Part01/04
  4. Message-ID: <csm-v39i093=psutils.121749@sparky.Sterling.COM>
  5. X-Md4-Signature: 2ad8190532bc0362a4c6de99e4f73d5b
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Mon, 20 Sep 1993 17:18:12 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: ajcd@dcs.ed.ac.uk (Angus Duggan)
  12. Posting-number: Volume 39, Issue 93
  13. Archive-name: psutils/part01
  14. Environment: UNIX, VMS, msdos
  15. Supersedes: psutils: Volume 35, Issue 8-11
  16.  
  17. PSUtils is a set of utilities for manipulating PostScript documents.
  18. Page selection and rearrangement are supported, including arrangement into
  19. signatures for booklet printing, and page merging for n-up printing.
  20.  
  21. ENVIRONMENT
  22. These utilities have been compiled and run on Sun-3 and Sun-4 machines under
  23. SunOS 5.1 (Solaris 2.1), 4.1.3, 4.1.2, 4.1.1 and 4.0.1, HP9000/375 machines
  24. under HPUX 7.0 and HPUX 8.0, Sequent Symmetry machines under Dynix 3.1.4
  25. and PTX 3.2.0, IBM RS/6000, VAX/VMS and Decstation 3100 machines under Ultrix
  26. 4.0.
  27.  
  28. PROGRAMS
  29. psbook          rearranges pages into signatures
  30. psselect        selects pages and page ranges
  31. pstops          performs general page rearrangement and selection
  32. psnup           put multiple pages per physical sheet of paper
  33. epsffit         fits an EPSF file to a given bounding box
  34.  
  35. SCRIPTS
  36. getafm   (sh)   outputs PostScript to retrieve AFM file from printer
  37. showchar (sh)   outputs PostScript to draw a character with metric info
  38. fixfmps  (perl) filter to fix framemaker documents so that psselect etc. work
  39. fixmacps (perl) filter to fix Macintosh documents with saner version of md
  40. fixpsditps (perl) filter to fix Transcript psdit documents to work with PSUtils
  41. fixpspps (perl) filter to fix PSPrint PostScript so that psselect etc. work
  42. fixtpps  (perl) filter to fix Troff Tpscript documents
  43. fixwfwps (perl) filter to fix Word for Windows documents for PSUtils
  44. fixwpps  (perl) filter to fix WordPerfect documents for PSUtils
  45. fixwwps  (perl) filter to fix Windows Write documents for PSUtils
  46.  
  47. ACKNOWLEDGEMENTS
  48. Bug fixes and suggestions for improvements to PSUtils have come from many
  49. people, including:
  50.  
  51.         Brian Colfer            brianc@labmed.ucsf.edu
  52.         Charles A. Finnell      finnell@org.mitre.lear
  53.         Conrad Kimball          cek@com.boeing.sdc
  54.         J.W.Hawtin              
  55.         Jochen Schwarze         schwarze@de.isa
  56.         Ken Carpenter           khc@edu.ksu.eece
  57.         Kristian Jorg           etxkrjg@se.ericsson.solsta
  58.         Larry Weissman          larryw@nsr.bioeng.washington.edu 
  59.         Michael L. Brown        brown%uucp.vidiot@edu.wisc.cs
  60.         Hunter Goatley            goathunter@wkuvx1.bitnet
  61.         John Interrante         interran@uluru.Stanford.edu
  62.         Maurizio Cremonesi      MAUCREM@imiclvx.earn
  63.         Matthew Stier           Matthew.Stier@East.Sun.com
  64.         Gerry Pratt             cca13@seq1.kl.ac.uk
  65.         Robert Joop             rj@rainbow.in-berlin.de
  66.  
  67. (Apologies to anyone who I have left out.)
  68.  
  69. NEWS
  70. There have been some significant enhancements to PSUtils, in preparation for 
  71. the eventual release of version 2 (don't hold your breath waiting for it).
  72. These include:
  73.  
  74. * Specify paper sizes by name for pstops and psnup.
  75. * Psnup re-written in C to be much more versatile (do any number n-up).
  76. * Epsffit can input broken %%BoundingBox comments which use real numbers.
  77. * Should work on MSDOS and VMS machines as well as Unix.
  78. * Accept more DSC compliant documents (Page labels are better supported).
  79.  
  80. Bug fixes and suggestions to ajcd@dcs.ed.ac.uk
  81.  
  82. Angus Duggan
  83. -----------
  84. #! /bin/sh
  85. # This is a shell archive.  Remove anything before this line, then unpack
  86. # it by saving it into a file and typing "sh file".  To overwrite existing
  87. # files, type "sh file -c".  You can also feed this as standard input via
  88. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  89. # will see the following message at the end:
  90. #        "End of archive 1 (of 4)."
  91. # Contents:  LICENSE Makefile Manifest README descrip.mms epsffit.man
  92. #   fixfmps.man fixfmps.pl fixmacps.man fixmacps.pl fixpsditps.man
  93. #   fixpsditps.pl fixpspps.man fixpspps.pl fixtpps.man fixtpps.pl
  94. #   fixwfwps.man fixwfwps.pl fixwpps.man fixwpps.pl fixwwps.man
  95. #   fixwwps.pl getafm.man patchlevel.h psbook.c psbook.man psnup.man
  96. #   psselect.man psspec.h pstops.man psutil.h showchar
  97. # Wrapped by ajcd@fivla on Fri Sep 17 14:10:19 1993
  98. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  99. if test -f LICENSE -a "${1}" != "-c" ; then 
  100.   echo shar: Will not over-write existing file \"LICENSE\"
  101. else
  102. echo shar: Extracting \"LICENSE\" \(1945 characters\)
  103. sed "s/^X//" >LICENSE <<'END_OF_LICENSE'
  104. X
  105. X                        PS Utilities Package
  106. X
  107. XThe constituent files of this package listed below are copyright (C) 1991,
  108. X1992, 1993 Angus J. C. Duggan.
  109. X
  110. XLICENSE         Makefile        Manifest        README          epsffit.c
  111. Xepsffit.man     fixfmps.man     fixfmps.pl      fixmacps.man    fixmacps.pl
  112. Xfixpsditps.man  fixpsditps.pl   fixpspps.man    fixpspps.pl     fixtpps.man
  113. Xfixtpps.pl      fixwfwps.man    fixwfwps.pl     fixwpps.man     fixwpps.pl
  114. Xfixwwps.man     fixwwps.pl      getafm.man      patchlevel.h    psbook.c
  115. Xpsbook.man      psnup.c         psnup.man       psselect.c      psselect.man
  116. Xpsspec.c        psspec.h        pstops.c        pstops.man      psutil.c
  117. Xpsutil.h        showchar
  118. X
  119. XThey may be copied and used for any purpose (including distribution as part of
  120. Xa for-profit product), provided:
  121. X
  122. X1) The original attribution of the programs is clearly displayed in the product
  123. X   and/or documentation, even if the programs are modified and/or renamed as
  124. X   part of the product.
  125. X
  126. X2) The original source code of the programs is provided free of charge (except
  127. X   for reasonable distribution costs). For a definition of reasonable
  128. X   distribution costs, see the Gnu General Public License or Larry Wall's
  129. X   Artistic License (provided with the Perl 4 kit). The GPL and Artistic
  130. X   License in NO WAY affect this license; they are merely used as examples of
  131. X   the spirit in which it is intended.
  132. X
  133. X3) These programs are provided "as-is". No warranty or guarantee of their
  134. X   fitness for any particular task is provided. Use of these programs is
  135. X   completely at your own risk.
  136. X
  137. XBasically, I don't mind how you use the programs so long as you acknowledge
  138. Xthe author, and give people the originals if they want them.
  139. X
  140. XThe included files, md68_0.ps and md71_0.ps (and their uuencoded forms) are
  141. X(to the best of my knowledge) copyright Apple Computer, Inc.
  142. X
  143. X                                                                AJCD 7/6/93
  144. END_OF_LICENSE
  145. if test 1945 -ne `wc -c <LICENSE`; then
  146.     echo shar: \"LICENSE\" unpacked with wrong size!
  147. fi
  148. # end of overwriting check
  149. fi
  150. if test -f Makefile -a "${1}" != "-c" ; then 
  151.   echo shar: Will not over-write existing file \"Makefile\"
  152. else
  153. echo shar: Extracting \"Makefile\" \(4034 characters\)
  154. sed "s/^X//" >Makefile <<'END_OF_Makefile'
  155. X# Makefile for PS utilities
  156. X
  157. XBINMODE=0755
  158. XMANMODE=0644
  159. XCHMOD=chmod
  160. XINSTALL=install -c -m $(BINMODE)
  161. XINSTALLMAN=install -c -m $(MANMODE)
  162. XBINDIR=/usr/local/bin
  163. XSCRIPTDIR=$(BINDIR)
  164. XMANDIR=/usr/local/share/man/man1
  165. XMANEXT=1
  166. XPAPER=a4
  167. XINCLUDEDIR=/usr/local/share/tex/dvips
  168. XPERL=/usr/local/bin/perl
  169. X
  170. X# CFLAGS variable controls compilation. Add following flags if necessary:
  171. X#    -DVMS    if compiling under VMS
  172. X#    -DMSDOS    if compiling under MSDOS
  173. XCFLAGS=-g -DPAPER=\"$(PAPER)\"
  174. X
  175. X# epsffit fits an epsf file to a given bounding box
  176. X# psbook rearranges pages into signatures
  177. X# psselect selects page ranges
  178. X# pstops performs general page rearrangement and merging
  179. X# psnup puts multiple logical pages on one physical page
  180. X
  181. X# definitions for Unix
  182. Xexe =
  183. Xobj = .o
  184. XBIN = psbook psselect pstops epsffit psnup
  185. XSHELLSCRIPTS = getafm
  186. XPERLSCRIPTS = fixfmps fixmacps fixpsditps fixpspps fixtpps fixwfwps fixwpps \
  187. X              fixwwps
  188. XINCLUDES = md68_0.ps md71_0.ps
  189. XMANPAGES = psbook.$(MANEXT) psselect.$(MANEXT) pstops.$(MANEXT) \
  190. X           epsffit.$(MANEXT) psnup.$(MANEXT) getafm.$(MANEXT) \
  191. X           fixfmps.$(MANEXT) fixmacps.$(MANEXT) fixpsditps.$(MANEXT) \
  192. X           fixpspps.$(MANEXT) fixtpps.$(MANEXT) fixwfwps.$(MANEXT) \
  193. X           fixwpps.$(MANEXT) fixwwps.$(MANEXT)
  194. XRM = rm -f
  195. X
  196. X# Definitions for MSDOS
  197. X#exe = .exe
  198. X#obj = .obj
  199. X#BIN = psbook$(exe) psselect$(exe) pstops$(exe) epsffit$(exe) psnup$(exe)
  200. X#PERLSCRIPTS =
  201. X#INCLUDES =
  202. X#MANPAGES =
  203. X#RM = del
  204. X
  205. X.SUFFIXES: .man .$(MANEXT)
  206. X
  207. X.man.$(MANEXT):
  208. X    R=`sed -n "s/.*RELEASE *//p" patchlevel.h`; \
  209. X    P=`sed -n "s/.*PATCHLEVEL *//p" patchlevel.h`; \
  210. X    M=`echo $(MANPAGES) | sed -e "s/\.$(MANEXT)/($(MANEXT)),/g" -e "s/, *$$//"`; \
  211. X    sed -e "s/@PL@/$$P/" -e "s/@REL@/$$R/" -e "s/@MAN@/$$M/" \
  212. X        -e "s/@PAPER@/$(PAPER)/" $< >$@
  213. X
  214. Xall: $(BIN) $(PERLSCRIPTS) $(MANPAGES)
  215. X
  216. Xepsffit$(exe): epsffit.c
  217. X    $(CC) $(CFLAGS) -o epsffit$(exe) epsffit.c
  218. X
  219. Xpsnup$(exe): psnup$(obj) psutil$(obj) psspec$(obj)
  220. X    $(CC) $(CFLAGS) -o psnup$(exe) psutil$(obj) psspec$(obj) psnup$(obj)
  221. X
  222. Xpsbook$(exe): psbook$(obj) psutil$(obj)
  223. X    $(CC) $(CFLAGS) -o psbook$(exe) psutil$(obj) psbook$(obj)
  224. X
  225. Xpsselect$(exe): psselect$(obj) psutil$(obj)
  226. X    $(CC) $(CFLAGS) -o psselect$(exe) psutil$(obj) psselect$(obj)
  227. X
  228. Xpstops$(exe): pstops$(obj) psutil$(obj) psspec$(obj)
  229. X    $(CC) $(CFLAGS) -o pstops$(exe) psutil$(obj) psspec$(obj) pstops$(obj)
  230. X
  231. Xpsnup$(obj): psutil.h patchlevel.h psspec.h psnup.c
  232. X
  233. Xpsbook$(obj): psutil.h patchlevel.h psbook.c
  234. X
  235. Xpstops$(obj): psutil.h patchlevel.h psspec.h pstops.c
  236. X
  237. Xpsselect$(obj): psutil.h patchlevel.h psselect.c
  238. X
  239. Xpsutil$(obj): psutil.h patchlevel.h psutil.c
  240. X
  241. Xpsspec$(obj): psutil.h patchlevel.h psspec.h psspec.c
  242. X
  243. Xfixfmps: fixfmps.pl
  244. X    sed -e "s%@PERL@%$(PERL)%" $? >$@; \
  245. X    $(CHMOD) $(BINMODE) $@
  246. X
  247. Xfixmacps: fixmacps.pl
  248. X    sed -e "s%@PERL@%$(PERL)%" \
  249. X        -e "s%@INCLUDE@%$(INCLUDEDIR)%" $? >$@; \
  250. X    $(CHMOD) $(BINMODE) $@
  251. X
  252. Xfixpsditps: fixpsditps.pl
  253. X    sed -e "s%@PERL@%$(PERL)%" $? >$@; \
  254. X    $(CHMOD) $(BINMODE) $@
  255. X
  256. Xfixpspps: fixpspps.pl
  257. X    sed -e "s%@PERL@%$(PERL)%" $? >$@; \
  258. X    $(CHMOD) $(BINMODE) $@
  259. X
  260. Xfixtpps: fixtpps.pl
  261. X    sed -e "s%@PERL@%$(PERL)%" $? >$@; \
  262. X    $(CHMOD) $(BINMODE) $@
  263. X
  264. Xfixwfwps: fixwfwps.pl
  265. X    sed -e "s%@PERL@%$(PERL)%" $? >$@; \
  266. X    $(CHMOD) $(BINMODE) $@
  267. X
  268. Xfixwpps: fixwpps.pl
  269. X    sed -e "s%@PERL@%$(PERL)%" $? >$@; \
  270. X    $(CHMOD) $(BINMODE) $@
  271. X
  272. Xfixwwps: fixwwps.pl
  273. X    sed -e "s%@PERL@%$(PERL)%" $? >$@; \
  274. X    $(CHMOD) $(BINMODE) $@
  275. X
  276. Xclean:
  277. X    $(RM) *$(obj)
  278. X
  279. Xveryclean realclean: clean
  280. X    $(RM) $(BIN) $(PERLSCRIPTS) $(MANPAGES)
  281. X
  282. Xinstall: install.bin install.script install.man install.include
  283. X
  284. Xinstall.bin: $(BIN)
  285. X    @for i in $(BIN); do \
  286. X        echo Installing $$i; \
  287. X        $(INSTALL) $$i $(BINDIR); \
  288. X    done
  289. X
  290. Xinstall.script: $(PERLSCRIPTS) $(SHELLSCRIPTS)
  291. X    @for i in $(PERLSCRIPTS) $(SHELLSCRIPTS); do \
  292. X        echo Installing $$i; \
  293. X        $(INSTALL) $$i $(SCRIPTDIR); \
  294. X    done
  295. X
  296. Xinstall.include: $(INCLUDES)
  297. X    @for i in $(INCLUDES); do \
  298. X        echo Installing $$i; \
  299. X        $(INSTALLMAN) $$i $(INCLUDEDIR); \
  300. X    done
  301. X
  302. Xinstall.man: $(MANPAGES)
  303. X    @for i in $(MANPAGES); do \
  304. X        echo Installing manual page for $$i; \
  305. X        $(INSTALLMAN) $$i $(MANDIR)/$$i; \
  306. X    done
  307. X
  308. END_OF_Makefile
  309. if test 4034 -ne `wc -c <Makefile`; then
  310.     echo shar: \"Makefile\" unpacked with wrong size!
  311. fi
  312. # end of overwriting check
  313. fi
  314. if test -f Manifest -a "${1}" != "-c" ; then 
  315.   echo shar: Will not over-write existing file \"Manifest\"
  316. else
  317. echo shar: Extracting \"Manifest\" \(443 characters\)
  318. sed "s/^X//" >Manifest <<'END_OF_Manifest'
  319. XLICENSE
  320. XMakefile
  321. XManifest
  322. XREADME
  323. Xdescrip.mms
  324. Xepsffit.c
  325. Xepsffit.man
  326. Xfixfmps.man
  327. Xfixfmps.pl
  328. Xfixmacps.man
  329. Xfixmacps.pl
  330. Xfixpsditps.man
  331. Xfixpsditps.pl
  332. Xfixpspps.man
  333. Xfixpspps.pl
  334. Xfixtpps.man
  335. Xfixtpps.pl
  336. Xfixwfwps.man
  337. Xfixwfwps.pl
  338. Xfixwpps.man
  339. Xfixwpps.pl
  340. Xfixwwps.man
  341. Xfixwwps.pl
  342. Xgetafm
  343. Xgetafm.man
  344. Xmd68_0.uue
  345. Xmd71_0.uue
  346. Xpatchlevel.h
  347. Xpsbook.c
  348. Xpsbook.man
  349. Xpsnup.c
  350. Xpsnup.man
  351. Xpsselect.c
  352. Xpsselect.man
  353. Xpsspec.c
  354. Xpsspec.h
  355. Xpstops.c
  356. Xpstops.man
  357. Xpsutil.c
  358. Xpsutil.h
  359. Xshowchar
  360. END_OF_Manifest
  361. if test 443 -ne `wc -c <Manifest`; then
  362.     echo shar: \"Manifest\" unpacked with wrong size!
  363. fi
  364. # end of overwriting check
  365. fi
  366. if test -f README -a "${1}" != "-c" ; then 
  367.   echo shar: Will not over-write existing file \"README\"
  368. else
  369. echo shar: Extracting \"README\" \(6316 characters\)
  370. sed "s/^X//" >README <<'END_OF_README'
  371. XPostScript Utilities            Angus Duggan                7 June 1993
  372. X
  373. XThis shar file contains some utilities for manipulating PostScript documents.
  374. XPage selection and rearrangement are supported, including arrangement into
  375. Xsignatures for booklet printing, and page merging for n-up printing.
  376. X
  377. XENVIRONMENT
  378. X
  379. XThese utilities have been compiled and run on Sun-3 and Sun-4 machines under
  380. XSunOS 5.1 (Solaris 2.1), 4.1.3, 4.1.2, 4.1.1 and 4.0.1, HP9000/375 machines
  381. Xunder HPUX 7.0 and HPUX 8.0, Sequent Symmetry machines under Dynix 3.1.4
  382. Xand PTX 3.2.0, IBM RS/6000, VAX/VMS and Decstation 3100 machines under Ultrix
  383. X4.0.
  384. X
  385. XFILES
  386. X
  387. XThe files contained are:
  388. X-rw-r--r--  1 ajcd         1945 Jun  7 15:40 LICENSE
  389. X-rw-r--r--  1 ajcd         3367 Jun  7 11:30 Makefile
  390. X-rw-r--r--  1 ajcd          432 Jun  7 11:33 Manifest
  391. X-rw-r--r--  1 ajcd         6295 Jun  7 15:40 README
  392. X-rw-r--r--  1 ajcd         1864 Jun  5 16:31 descrip.mms
  393. X-rw-r--r--  1 ajcd         4431 Jun  5 11:05 epsffit.c
  394. X-rw-r--r--  1 ajcd         1045 Jun  7 11:01 epsffit.man
  395. X-rw-r--r--  1 ajcd          538 Apr  9 22:33 fixfmps.man
  396. X-rw-r--r--  1 ajcd          419 Apr  9 17:14 fixfmps.pl
  397. X-rw-r--r--  1 ajcd          559 Apr  9 22:35 fixmacps.man
  398. X-rw-r--r--  1 ajcd         1751 Jun  7 11:30 fixmacps.pl
  399. X-rw-r--r--  1 ajcd          564 Apr  9 22:35 fixpsditps.man
  400. X-rw-r--r--  1 ajcd          596 Apr  9 17:15 fixpsditps.pl
  401. X-rw-r--r--  1 ajcd          533 Apr  9 22:35 fixpspps.man
  402. X-rw-r--r--  1 ajcd         1236 Apr  9 17:15 fixpspps.pl
  403. X-rw-r--r--  1 ajcd          551 Apr  9 22:32 fixtpps.man
  404. X-rw-r--r--  1 ajcd          602 Apr  9 22:31 fixtpps.pl
  405. X-rw-r--r--  1 ajcd          556 Apr  9 22:36 fixwfwps.man
  406. X-rw-r--r--  1 ajcd          318 Apr  9 17:15 fixwfwps.pl
  407. X-rw-r--r--  1 ajcd          544 Apr  9 22:36 fixwpps.man
  408. X-rw-r--r--  1 ajcd          669 May  5 13:54 fixwpps.pl
  409. X-rw-r--r--  1 ajcd          542 Apr 22 12:38 fixwwps.man
  410. X-rw-r--r--  1 ajcd          364 Apr 22 12:37 fixwwps.pl
  411. X-rwxr-xr-x  1 ajcd         6124 Jun  7 15:25 getafm
  412. X-rw-r--r--  1 ajcd          702 Jun  7 15:38 getafm.man
  413. X-rw-r--r--  1 ajcd        42798 May  6 09:16 md68_0.uue
  414. X-rw-r--r--  1 ajcd        48726 May  6 09:16 md71_0.uue
  415. X-rw-r--r--  1 ajcd           40 Apr  9 21:03 patchlevel.h
  416. X-rw-r--r--  1 ajcd         2155 Jun  4 15:23 psbook.c
  417. X-rw-r--r--  1 ajcd         1059 Mar 31 15:33 psbook.man
  418. X-rw-r--r--  1 ajcd         6967 Jun  7 10:29 psnup.c
  419. X-rw-r--r--  1 ajcd         2578 Jun  7 11:28 psnup.man
  420. X-rw-r--r--  1 ajcd         5298 Jun  4 15:24 psselect.c
  421. X-rw-r--r--  1 ajcd         1893 Mar 31 15:33 psselect.man
  422. X-rw-r--r--  1 ajcd         6682 Jun  5 16:49 psspec.c
  423. X-rw-r--r--  1 ajcd          604 Jun  5 13:38 psspec.h
  424. X-rw-r--r--  1 ajcd         4215 Jun  5 13:04 pstops.c
  425. X-rw-r--r--  1 ajcd         3512 Jun  7 10:43 pstops.man
  426. X-rw-r--r--  1 ajcd         8195 Jun  5 16:43 psutil.c
  427. X-rw-r--r--  1 ajcd          988 Jun  5 14:48 psutil.h
  428. X-rwxr-xr-x  1 ajcd         2552 Feb 10 12:47 showchar
  429. X
  430. XPROGRAMS
  431. X
  432. Xpsbook          rearranges pages into signatures
  433. Xpsselect        selects pages and page ranges
  434. Xpstops          performs general page rearrangement and selection
  435. Xpsnup           put multiple pages per physical sheet of paper
  436. Xepsffit         fits an EPSF file to a given bounding box
  437. X
  438. Xpsselect in modeled after Chris Torek's dviselect program, and pstops is
  439. Xmodeled after Tom Rokicki's dvidvi program. psbook is modeled on my own
  440. Xdvibook program, which borrows heavily from Chris Torek's dviselect.
  441. X
  442. XSCRIPTS
  443. X
  444. Xgetafm   (sh)   outputs PostScript to retrieve AFM file from printer
  445. Xshowchar (sh)   outputs PostScript to draw a character with metric info
  446. Xfixfmps  (perl) filter to fix framemaker documents so that psselect etc. work
  447. Xfixmacps (perl) filter to fix Macintosh documents with saner version of md
  448. Xfixpsditps (perl) filter to fix Transcript psdit documents to work with PSUtils
  449. Xfixpspps (perl) filter to fix PSPrint PostScript so that psselect etc. work
  450. Xfixtpps  (perl) filter to fix Troff Tpscript documents
  451. Xfixwfwps (perl) filter to fix Word for Windows documents for PSUtils
  452. Xfixwpps  (perl) filter to fix WordPerfect documents for PSUtils
  453. Xfixwwps  (perl) filter to fix Windows Write documents for PSUtils
  454. X
  455. XINSTALLATION
  456. X
  457. XUUdecode md71_0.uue and md68_0.uue (if supplied encoded), edit Makefile to put
  458. Xin required paths and CFLAGS (-DSYSV for System V machines, -DMSDOS for
  459. XMessy-DOS, -DVMS for VMS), "make", and "make install".
  460. X
  461. XBUGS
  462. X
  463. XThe utilities don't check for PS-Adobe-?.? conformance; they assume documents
  464. Xconform. Utilities need an extra save/restore around whole document on a
  465. XSPARCPrinter with NeWSPrint 1.0, because of bugs in the xnews server.
  466. X
  467. XBug fixes and suggestions to ajcd@dcs.ed.ac.uk
  468. X
  469. XNOTE
  470. X
  471. XThis is an interim release; these utilities are currently being re-written
  472. Xfrom scratch, with a full DSC-3.0 parser and more extraction, merging, and
  473. Xinclusion options included.
  474. X
  475. XACKNOWLEDGEMENTS
  476. X
  477. XBug fixes and suggestions for improvements to PSUtils have come from many
  478. Xpeople, including:
  479. X
  480. X        Brian Colfer            brianc@labmed.ucsf.edu
  481. X        Charles A. Finnell      finnell@org.mitre.lear
  482. X        Conrad Kimball          cek@com.boeing.sdc
  483. X        J.W.Hawtin              
  484. X        Jochen Schwarze         schwarze@de.isa
  485. X        Ken Carpenter           khc@edu.ksu.eece
  486. X        Kristian Jorg           etxkrjg@se.ericsson.solsta
  487. X        Larry Weissman          larryw@nsr.bioeng.washington.edu 
  488. X        Michael L. Brown        brown%uucp.vidiot@edu.wisc.cs
  489. X        Hunter Goatley            goathunter@wkuvx1.bitnet
  490. X        John Interrante         interran@uluru.Stanford.edu
  491. X        Maurizio Cremonesi      MAUCREM@imiclvx.earn
  492. X        Matthew Stier           Matthew.Stier@East.Sun.com
  493. X        Gerry Pratt             cca13@seq1.kl.ac.uk
  494. X        Robert Joop             rj@rainbow.in-berlin.de
  495. X
  496. X(Apologies to anyone who I have left out.)
  497. X
  498. XNEWS
  499. X
  500. XPatchlevel 11 contains some significant enhancements to PSUtils, in
  501. Xpreparation for the eventual release of version 2 (don't hold your breath
  502. Xwaiting for it). These include:
  503. X
  504. X* Specify paper sizes by name for pstops and psnup.
  505. X* Psnup re-written in C to be much more versatile (do any number n-up).
  506. X* Epsffit can input broken %%BoundingBox comments which use real numbers.
  507. X* Should work on MSDOS and VMS machines as well as Unix.
  508. X* Accept more DSC compliant documents (Page labels are better supported).
  509. END_OF_README
  510. if test 6316 -ne `wc -c <README`; then
  511.     echo shar: \"README\" unpacked with wrong size!
  512. fi
  513. # end of overwriting check
  514. fi
  515. if test -f descrip.mms -a "${1}" != "-c" ; then 
  516.   echo shar: Will not over-write existing file \"descrip.mms\"
  517. else
  518. echo shar: Extracting \"descrip.mms\" \(1863 characters\)
  519. sed "s/^X//" >descrip.mms <<'END_OF_descrip.mms'
  520. X#
  521. X#  VMS MMS build file for PS utilities
  522. X#
  523. X#  Hunter Goatley, 16-MAR-1993 14:47
  524. X#
  525. XCFLAGS = /NOLIST/OBJECT=$(MMS$TARGET)
  526. XLFLAGS = /NOTRACE/EXEC=$(MMS$TARGET)
  527. X
  528. X.IFDEF __ALPHA__               #If building with Alpha cross-compilers, OBJ
  529. XOPTIONS_FILE =                  #... is defined already
  530. XLINKOPT =
  531. XCFLAGS = /NOLIST/OBJECT=$(MMS$TARGET)/STANDARD=VAXC
  532. X.ELSE
  533. XOBJ = .OBJ
  534. XEXE = .EXE
  535. XOPTIONS_FILE = ,VAXC.OPT
  536. XLINKOPT = $(options_file)/OPTIONS
  537. X.ENDIF
  538. X
  539. X# epsffit fits an epsf file to a given bounding box
  540. X# psbook rearranges pages into signatures
  541. X# psselect selects page ranges
  542. X# pstops performs general page rearrangement and merging
  543. X# psnup puts multiple logical pages on one physical page
  544. X
  545. Xall : psbook$(exe), psselect$(exe), pstops$(exe), epsffit$(exe), psnup$(exe)
  546. X        @ write sys$output "PSUTILS build complete"
  547. X
  548. Xepsffit$(exe) : epsffit$(obj)$(options_file)
  549. X        $(LINK)$(LFLAGS) $(MMS$SOURCE)$(linkopt)
  550. X
  551. Xpsnup$(exe) :   psnup$(obj), psutil$(obj), psspec$(obj)
  552. X        $(LINK)$(LFLAGS) psnup$(obj),psutil$(obj),psspec$(obj)$(linkopt)
  553. X
  554. Xpsbook$(exe) :  psbook$(obj), psutil$(obj)$(options_file)
  555. X        $(LINK)$(LFLAGS) psbook$(obj),psutil$(obj)$(linkopt)
  556. X
  557. Xpsselect$(exe) :        psselect$(obj), psutil$(obj)
  558. X        $(LINK)$(LFLAGS) psselect$(obj),psutil$(obj)$(linkopt)
  559. X
  560. Xpstops$(exe) :  pstops$(obj), psutil$(obj), psspec$(obj)
  561. X        $(LINK)$(LFLAGS) pstops$(obj),psutil$(obj),psspec$(obj)$(linkopt)
  562. X
  563. Xpsnup$(obj)  : psnup.c, psutil.h patchlevel.h psspec.h
  564. X
  565. Xpsbook$(obj) : psbook.c, psutil.h patchlevel.h
  566. X
  567. Xpstops$(obj) : pstops.c, psutil.h patchlevel.h psspec.h
  568. X
  569. Xpsutil$(obj) : psutil.c, psutil.h patchlevel.h
  570. X
  571. Xpsselect$(obj) : psselect.c, psutil.h patchlevel.h
  572. X
  573. Xpsspec$(obj) : psspec.c, psutil.h patchlevel.h psspec.h
  574. X
  575. Xclean :
  576. X        delete/log *$(obj);*,psnup$(exe);*,psbook$(exe);*,-
  577. X                psselect$(exe);*,pstops$(exe);*,epsffit$(exe);*
  578. X
  579. X
  580. END_OF_descrip.mms
  581. if test 1863 -ne `wc -c <descrip.mms`; then
  582.     echo shar: \"descrip.mms\" unpacked with wrong size!
  583. fi
  584. # end of overwriting check
  585. fi
  586. if test -f epsffit.man -a "${1}" != "-c" ; then 
  587.   echo shar: Will not over-write existing file \"epsffit.man\"
  588. else
  589. echo shar: Extracting \"epsffit.man\" \(1165 characters\)
  590. sed "s/^X//" >epsffit.man <<'END_OF_epsffit.man'
  591. X.TH EPSFFIT 1 "PSUtils Release @REL@ Patchlevel @PL@"
  592. X.SH NAME
  593. Xepsffit \- fit encapsulated PostScript file (EPSF) into constrained size
  594. X.SH SYNOPSIS
  595. X.B epsffit
  596. X[
  597. X.B \-c
  598. X] [
  599. X.B \-r
  600. X] [
  601. X.B \-a
  602. X] [
  603. X.B \-m
  604. X] [
  605. X.B \-s
  606. X]
  607. X.I "llx lly urx ury"
  608. X[
  609. X.B file
  610. X]
  611. X.SH DESCRIPTION
  612. X.I Epsffit
  613. Xfits an EPSF file (encapsulated PostScript) to a given bounding box.
  614. XThe coordinates of the box are given by \fB(llx,lly)\fR for the lower
  615. Xleft, and \fB(urx,ury)\fR for the upper right, in PostScript units (points).
  616. X.PP
  617. XIf no file is specified,
  618. X.I epsffit
  619. Xuses the standard input. Output is always to the standard output.
  620. X.SH OPTIONS
  621. X.IP \fB\-c\fP 1i
  622. XCenter the image in the given bounding box.
  623. X.IP \fB\-r\fP 1i
  624. XRotate the image by 90 degrees counter-clockwise.
  625. X.IP \fB\-a\fP 1i
  626. XAdjust the aspect ratio to fit the bounding box. The default is to preserve
  627. Xthe aspect ratio.
  628. X.IP \fB\-m\fP 1i
  629. XRotates the image to maximise the size if it would fit the specified bounding
  630. Xbox better.
  631. X.IP \fB\-s\fP 1i
  632. XAdd a \fIshowpage\fP at the end of the file to force the image to print.
  633. X.SH AUTHOR
  634. XAngus Duggan
  635. X.SH "SEE ALSO"
  636. X@MAN@
  637. X.SH TRADEMARKS
  638. X.B PostScript
  639. Xis a trademark of Adobe Systems Incorporated.
  640. END_OF_epsffit.man
  641. if test 1165 -ne `wc -c <epsffit.man`; then
  642.     echo shar: \"epsffit.man\" unpacked with wrong size!
  643. fi
  644. # end of overwriting check
  645. fi
  646. if test -f fixfmps.man -a "${1}" != "-c" ; then 
  647.   echo shar: Will not over-write existing file \"fixfmps.man\"
  648. else
  649. echo shar: Extracting \"fixfmps.man\" \(461 characters\)
  650. sed "s/^X//" >fixfmps.man <<'END_OF_fixfmps.man'
  651. X.TH FIXFMPS 1 "PSUtils Release @REL@ Patchlevel @PL@"
  652. X.SH NAME
  653. Xfixfmps \- filter to fix Framemaker documents so PSUtils work
  654. X.SH SYNOPSIS
  655. X.B fixfmps 
  656. X< 
  657. X.I Framemaker.ps
  658. X>
  659. X.I Fixed.ps
  660. X.SH DESCRIPTION
  661. X.I Fixfmps
  662. Xis a 
  663. X.I perl 
  664. Xfilter which "fixes" PostScript from Framemaker so
  665. Xthat it works correctly with Angus Duggan's
  666. X.B psutils
  667. Xpackage.
  668. X.SH AUTHOR
  669. XAngus Duggan
  670. X.SH "SEE ALSO"
  671. X@MAN@
  672. X.SH TRADEMARKS
  673. X.B PostScript
  674. Xis a trademark of Adobe Systems Incorporated.
  675. END_OF_fixfmps.man
  676. if test 461 -ne `wc -c <fixfmps.man`; then
  677.     echo shar: \"fixfmps.man\" unpacked with wrong size!
  678. fi
  679. # end of overwriting check
  680. fi
  681. if test -f fixfmps.pl -a "${1}" != "-c" ; then 
  682.   echo shar: Will not over-write existing file \"fixfmps.pl\"
  683. else
  684. echo shar: Extracting \"fixfmps.pl\" \(419 characters\)
  685. sed "s/^X//" >fixfmps.pl <<'END_OF_fixfmps.pl'
  686. X#!@PERL@
  687. X# fixfmps: get conforming PostScript out of FrameMaker file
  688. X# move all FMDEFINEFONTs to start of pages
  689. X
  690. X# feed this into perl
  691. Xeval 'exec perl -S $0 "$@"'
  692. X   if $running_under_some_shell;
  693. X
  694. X%fonts=();
  695. X
  696. Xwhile (<>) {
  697. X   if (/^([0-9]+) [0-9]+ .* FMDEFINEFONT$/) {
  698. X      $fonts{$1} = $_;
  699. X   } elsif (/^[0-9]+ [0-9]+ [0-9]+ FMBEGINPAGE$/) {
  700. X      print $_, join('',values(%fonts));
  701. X   } else {
  702. X      print $_;
  703. X   }
  704. X}
  705. END_OF_fixfmps.pl
  706. if test 419 -ne `wc -c <fixfmps.pl`; then
  707.     echo shar: \"fixfmps.pl\" unpacked with wrong size!
  708. fi
  709. # end of overwriting check
  710. fi
  711. if test -f fixmacps.man -a "${1}" != "-c" ; then 
  712.   echo shar: Will not over-write existing file \"fixmacps.man\"
  713. else
  714. echo shar: Extracting \"fixmacps.man\" \(483 characters\)
  715. sed "s/^X//" >fixmacps.man <<'END_OF_fixmacps.man'
  716. X.TH FIXMACPS 1 "PSUtils Release @REL@ Patchlevel @PL@"
  717. X.SH NAME
  718. Xfixmacps \- filter to fix Macintosh documents with saner version of md
  719. X.SH SYNOPSIS
  720. X.B fixmacps 
  721. X< 
  722. X.I Macintosh.ps
  723. X>
  724. X.I Fixed.ps
  725. X.SH DESCRIPTION
  726. X.I Fixmacps
  727. Xis a 
  728. X.I perl 
  729. Xfilter which "fixes" PostScript generated from a Macintosh PC
  730. Xthat it works correctly with Angus Duggan's
  731. X.B psutils
  732. Xpackage.
  733. X.SH AUTHOR
  734. XAngus Duggan
  735. X.SH "SEE ALSO"
  736. X@MAN@
  737. X.SH TRADEMARKS
  738. X.B PostScript
  739. Xis a trademark of Adobe Systems Incorporated.
  740. END_OF_fixmacps.man
  741. if test 483 -ne `wc -c <fixmacps.man`; then
  742.     echo shar: \"fixmacps.man\" unpacked with wrong size!
  743. fi
  744. # end of overwriting check
  745. fi
  746. if test -f fixmacps.pl -a "${1}" != "-c" ; then 
  747.   echo shar: Will not over-write existing file \"fixmacps.pl\"
  748. else
  749. echo shar: Extracting \"fixmacps.pl\" \(1754 characters\)
  750. sed "s/^X//" >fixmacps.pl <<'END_OF_fixmacps.pl'
  751. X#!@PERL@
  752. X# fixmacps: swap to sanitised appledict
  753. X
  754. X# feed this into perl
  755. Xeval 'exec perl -S $0 "$@"'
  756. X   if $running_under_some_shell;
  757. X
  758. X$line = 0;            # keep line count
  759. X$dir = "@INCLUDE@";
  760. X$prefix = "md";
  761. X$default = "md71_0.ps";
  762. X
  763. Xwhile ($_ = shift(@ARGV)) {
  764. X   if (/^-d(ir)?$/)   { $dir = shift(@ARGV); }
  765. X   elsif (/^-n(ame)?$/)   { $prefix = shift(@ARGV); }
  766. X   else {
  767. X      unshift(@ARGV, $_);
  768. X      last;
  769. X   }
  770. X}
  771. X
  772. X%fonts = ();
  773. X$nesting = 0;
  774. X
  775. Xwhile (<>) {
  776. X   if (/^%!/) {
  777. X      if (! $line) {
  778. X     print;
  779. X      }
  780. X   } elsif (/^%%BeginProcSet: "?\(AppleDict md\)"? ([0-9]+) ([0-9]+)$/) {
  781. X      local($mdv, $mdr) = ($1, $2);
  782. X      if (open(SANE, "<$dir/$prefix${mdv}_$mdr.ps") ||
  783. X      open(SANE, "<$dir/$default")) {
  784. X     $sane = <SANE>;
  785. X     local($snv, $snr) =
  786. X        $sane =~ /^%%BeginProcSet: \(AppleDict md\) ([0-9]+) ([0-9]+)$/;
  787. X     if ($mdv == $snv && $mdr == $snr) {
  788. X        $ignore = 1;
  789. X     } else {
  790. X        print STDERR "Unrecognised AppleDict version $mdv $mdr\n";
  791. X        print "%!\n" if !$line;
  792. X        print;
  793. X     }
  794. X      } else {
  795. X     print STDERR "Can't find sanitised AppleDict\n";
  796. X     print "%!\n" if !$line;
  797. X     print;
  798. X      }
  799. X   } elsif (/^%%EndProcSet/) {
  800. X      if ($ignore) {
  801. X     $ignore = 0;
  802. X     print "%!\n" if !$line;
  803. X     print $sane;
  804. X     while(<SANE>) {
  805. X        print;
  806. X     }
  807. X     close(SANE);
  808. X      } else {
  809. X     print "%!\n" if !$line;
  810. X     print;
  811. X      }
  812. X   } elsif (/^%%Page:/ && $nesting == 0) {
  813. X      print $_;
  814. X      print values(%fonts);
  815. X   } elsif (/^%%BeginDocument/ || /^%%BeginBinary/) {
  816. X      print $_;
  817. X      $nesting++;
  818. X   } elsif (/^%%EndDocument/ || /^%%EndBinary/) {
  819. X      print $_;
  820. X      $nesting--;
  821. X   } else {
  822. X      if (! $ignore) {
  823. X     if (/^\{\}mark .*rf$/) {
  824. X        $fonts{$_} = $_;
  825. X        print;
  826. X     } else {
  827. X        print "%!\n" if !$line;
  828. X        print;
  829. X     }
  830. X      }
  831. X   }
  832. X   $line++;
  833. X}
  834. END_OF_fixmacps.pl
  835. if test 1754 -ne `wc -c <fixmacps.pl`; then
  836.     echo shar: \"fixmacps.pl\" unpacked with wrong size!
  837. fi
  838. # end of overwriting check
  839. fi
  840. if test -f fixpsditps.man -a "${1}" != "-c" ; then 
  841.   echo shar: Will not over-write existing file \"fixpsditps.man\"
  842. else
  843. echo shar: Extracting \"fixpsditps.man\" \(490 characters\)
  844. sed "s/^X//" >fixpsditps.man <<'END_OF_fixpsditps.man'
  845. X.TH FIXPSDITPS 1 "PSUtils Release @REL@ Patchlevel @PL@"
  846. X.SH NAME
  847. Xfixpsditps \- filter to fix Transcript psdit documents so PSUtils work
  848. X.SH SYNOPSIS
  849. X.B fixpsditps 
  850. X< 
  851. X.I psdit.ps
  852. X>
  853. X.I Fixed.ps
  854. X.SH DESCRIPTION
  855. X.I Fixpsditps
  856. Xis a 
  857. X.I perl 
  858. Xfilter which "fixes" PostScript from Transcript's psdit program so
  859. Xthat it works correctly with Angus Duggan's
  860. X.B psutils
  861. Xpackage.
  862. X.SH AUTHOR
  863. XAngus Duggan
  864. X.SH "SEE ALSO"
  865. X@MAN@
  866. X.SH TRADEMARKS
  867. X.B PostScript
  868. Xis a trademark of Adobe Systems Incorporated.
  869. END_OF_fixpsditps.man
  870. if test 490 -ne `wc -c <fixpsditps.man`; then
  871.     echo shar: \"fixpsditps.man\" unpacked with wrong size!
  872. fi
  873. # end of overwriting check
  874. fi
  875. if test -f fixpsditps.pl -a "${1}" != "-c" ; then 
  876.   echo shar: Will not over-write existing file \"fixpsditps.pl\"
  877. else
  878. echo shar: Extracting \"fixpsditps.pl\" \(596 characters\)
  879. sed "s/^X//" >fixpsditps.pl <<'END_OF_fixpsditps.pl'
  880. X#!@PERL@
  881. X# fixpsditps: fix psdit output for use in psutils
  882. X
  883. X# feed this into perl
  884. Xeval 'exec perl -S $0 "$@"'
  885. X   if $running_under_some_shell;
  886. X
  887. X$nesting = 0;
  888. X
  889. Xwhile (<>) {
  890. X   if (/^\/p{pop showpage pagesave restore \/pagesave save def}def$/) {
  891. X      print "/p{pop showpage pagesave restore}def\n";
  892. X   } elsif (/^%%BeginDocument/ || /^%%BeginBinary/) {
  893. X      print $_;
  894. X      $nesting++;
  895. X   } elsif (/^%%EndDocument/ || /^%%EndBinary/) {
  896. X      print $_;
  897. X      $nesting--;
  898. X   } elsif (/^%%Page:/ && $nesting == 0) {
  899. X      print $_;
  900. X      print "xi\n";
  901. X   } elsif (! /^xi$/) {
  902. X      print $_;
  903. X   }
  904. X}
  905. END_OF_fixpsditps.pl
  906. if test 596 -ne `wc -c <fixpsditps.pl`; then
  907.     echo shar: \"fixpsditps.pl\" unpacked with wrong size!
  908. fi
  909. # end of overwriting check
  910. fi
  911. if test -f fixpspps.man -a "${1}" != "-c" ; then 
  912.   echo shar: Will not over-write existing file \"fixpspps.man\"
  913. else
  914. echo shar: Extracting \"fixpspps.man\" \(457 characters\)
  915. sed "s/^X//" >fixpspps.man <<'END_OF_fixpspps.man'
  916. X.TH FIXPSPPS 1 "PSUtils Release @REL@ Patchlevel @PL@"
  917. X.SH NAME
  918. Xfixpspps \- filter to fix PSPrint PostScript so PSUtils work
  919. X.SH SYNOPSIS
  920. X.B fixpspps 
  921. X< 
  922. X.I PSPrint.ps
  923. X>
  924. X.I Fixed.ps
  925. X.SH DESCRIPTION
  926. X.I Fixpspps
  927. Xis a 
  928. X.I perl 
  929. Xfilter which "fixes" PostScript from PSPrint so
  930. Xthat it works correctly with Angus Duggan's
  931. X.B psutils
  932. Xpackage.
  933. X.SH AUTHOR
  934. XAngus Duggan
  935. X.SH "SEE ALSO"
  936. X@MAN@
  937. X.SH TRADEMARKS
  938. X.B PostScript
  939. Xis a trademark of Adobe Systems Incorporated.
  940. END_OF_fixpspps.man
  941. if test 457 -ne `wc -c <fixpspps.man`; then
  942.     echo shar: \"fixpspps.man\" unpacked with wrong size!
  943. fi
  944. # end of overwriting check
  945. fi
  946. if test -f fixpspps.pl -a "${1}" != "-c" ; then 
  947.   echo shar: Will not over-write existing file \"fixpspps.pl\"
  948. else
  949. echo shar: Extracting \"fixpspps.pl\" \(1236 characters\)
  950. sed "s/^X//" >fixpspps.pl <<'END_OF_fixpspps.pl'
  951. X#!@PERL@
  952. X# mangle PostScript produced by PSPrint to make it almost conforming
  953. X
  954. X# feed this into perl
  955. Xeval 'exec perl -S $0 "$@"'
  956. X   if $running_under_some_shell;
  957. X
  958. X$header = 1; $ignore = 0;
  959. X$verbose = 0;
  960. X@body = ();
  961. X%fonts = (); $font = "";
  962. X$inchar = 0; @char = ();
  963. X
  964. Xwhile (<>) {
  965. X   if (/^@end$/) {
  966. X      $ignore = 1;
  967. X   } elsif (/^[0-9]+ @bop0$/) {
  968. X      $ignore = 0;
  969. X      $header = 1;
  970. X   } elsif ($header) {
  971. X      if (/^\/([a-z.0-9]+) @newfont$/) {
  972. X     if (! defined($fonts{$1})) {
  973. X        $fonts{$1} = 1;
  974. X        print;
  975. X     } elsif ($verbose) {
  976. X        print STDERR "$font already defined\n";
  977. X     }
  978. X      } elsif (/^([a-z.0-9]+) sf$/) {
  979. X     $font = $1;
  980. X     print;
  981. X      } elsif (/^\[</) {
  982. X     $inchar = 1;
  983. X     push (@char, $_);
  984. X      } elsif ($inchar) {
  985. X     push (@char, $_);
  986. X     if (/.*\] ([0-9]+) dc$/) {
  987. X        if (! defined($fonts{$font,$1})) {
  988. X           $fonts{$font,$1} = 1;
  989. X           print (@char);
  990. X        } elsif ($verbose) {
  991. X           print STDERR "$font character $1 already defined\n";
  992. X        }
  993. X        $inchar = 0;
  994. X        @char = ();
  995. X     }
  996. X      } elsif (/^([0-9]+) @bop1$/) {
  997. X     $header = 0;
  998. X     push (@body, "%%Page: ? $1\n");
  999. X     push (@body, $_);
  1000. X      } else {
  1001. X     print;
  1002. X      }
  1003. X   } elsif (! $ignore) {
  1004. X      push (@body, $_);
  1005. X   }
  1006. X}
  1007. Xprint (@body);
  1008. Xprint ("@end\n");
  1009. END_OF_fixpspps.pl
  1010. if test 1236 -ne `wc -c <fixpspps.pl`; then
  1011.     echo shar: \"fixpspps.pl\" unpacked with wrong size!
  1012. fi
  1013. # end of overwriting check
  1014. fi
  1015. if test -f fixtpps.man -a "${1}" != "-c" ; then 
  1016.   echo shar: Will not over-write existing file \"fixtpps.man\"
  1017. else
  1018. echo shar: Extracting \"fixtpps.man\" \(487 characters\)
  1019. sed "s/^X//" >fixtpps.man <<'END_OF_fixtpps.man'
  1020. X.TH FIXTPPS 1 "PSUtils Release @REL@ Patchlevel @PL@"
  1021. X.SH NAME
  1022. Xfixtpps \- filter to fix Tpscript documents to work with PSUtils
  1023. X.SH SYNOPSIS
  1024. X.B fixtpps 
  1025. X< 
  1026. X.I Tpscript.ps
  1027. X>
  1028. X.I Fixed.ps
  1029. X.SH DESCRIPTION
  1030. X.I Fixtpps
  1031. Xis a 
  1032. X.I perl 
  1033. Xfilter which "fixes" PostScript generated from the Troff Tpscript driver so
  1034. Xthat it works correctly with Angus Duggan's
  1035. X.B psutils
  1036. Xpackage.
  1037. X.SH AUTHOR
  1038. XAngus Duggan
  1039. X.SH "SEE ALSO"
  1040. X@MAN@
  1041. X.SH TRADEMARKS
  1042. X.B PostScript
  1043. Xis a trademark of Adobe Systems Incorporated.
  1044. END_OF_fixtpps.man
  1045. if test 487 -ne `wc -c <fixtpps.man`; then
  1046.     echo shar: \"fixtpps.man\" unpacked with wrong size!
  1047. fi
  1048. # end of overwriting check
  1049. fi
  1050. if test -f fixtpps.pl -a "${1}" != "-c" ; then 
  1051.   echo shar: Will not over-write existing file \"fixtpps.pl\"
  1052. else
  1053. echo shar: Extracting \"fixtpps.pl\" \(602 characters\)
  1054. sed "s/^X//" >fixtpps.pl <<'END_OF_fixtpps.pl'
  1055. X#!@PERL@
  1056. X# fixtpps: fix tpscript document to work with PSUtils
  1057. X
  1058. X# feed this into perl
  1059. Xeval 'exec perl -S $0 "$@"'
  1060. X   if $running_under_some_shell;
  1061. X
  1062. X$nesting = 0;
  1063. X$header = 1;
  1064. X
  1065. Xwhile (<>) {
  1066. X   if (/^%%Page:/ && $nesting == 0) {
  1067. X      print $_;
  1068. X      print "save home\n";
  1069. X      $header = 0;
  1070. X   } elsif (/^%%BeginDocument/ || /^%%BeginBinary/) {
  1071. X      print $_;
  1072. X      $nesting++;
  1073. X   } elsif (/^%%EndDocument/ || /^%%EndBinary/) {
  1074. X      print $_;
  1075. X      $nesting--;
  1076. X   } elsif (/save home/) {
  1077. X      s/save home//;
  1078. X      print $_;
  1079. X   } elsif (!$header || (! /^save$/ && ! /^home$/)) {
  1080. X      print $_;
  1081. X   }
  1082. X}
  1083. END_OF_fixtpps.pl
  1084. if test 602 -ne `wc -c <fixtpps.pl`; then
  1085.     echo shar: \"fixtpps.pl\" unpacked with wrong size!
  1086. fi
  1087. # end of overwriting check
  1088. fi
  1089. if test -f fixwfwps.man -a "${1}" != "-c" ; then 
  1090.   echo shar: Will not over-write existing file \"fixwfwps.man\"
  1091. else
  1092. echo shar: Extracting \"fixwfwps.man\" \(481 characters\)
  1093. sed "s/^X//" >fixwfwps.man <<'END_OF_fixwfwps.man'
  1094. X.TH FIXWFWPS 1 "PSUtils Release @REL@ Patchlevel @PL@"
  1095. X.SH NAME
  1096. Xfixwfwps \- filter to fix Word for Windows documents so PSUtils work
  1097. X.SH SYNOPSIS
  1098. X.B fixwfwps 
  1099. X< 
  1100. X.I WordforWindows.ps
  1101. X>
  1102. X.I Fixed.ps
  1103. X.SH DESCRIPTION
  1104. X.I Fixwfwps
  1105. Xis a 
  1106. X.I perl 
  1107. Xfilter which "fixes" PostScript from Word for Windows so
  1108. Xthat it works correctly with Angus Duggan's
  1109. X.B psutils
  1110. Xpackage.
  1111. X.SH AUTHOR
  1112. XAngus Duggan
  1113. X.SH "SEE ALSO"
  1114. X@MAN@
  1115. X.SH TRADEMARKS
  1116. X.B PostScript
  1117. Xis a trademark of Adobe Systems Incorporated.
  1118. END_OF_fixwfwps.man
  1119. if test 481 -ne `wc -c <fixwfwps.man`; then
  1120.     echo shar: \"fixwfwps.man\" unpacked with wrong size!
  1121. fi
  1122. # end of overwriting check
  1123. fi
  1124. if test -f fixwfwps.pl -a "${1}" != "-c" ; then 
  1125.   echo shar: Will not over-write existing file \"fixwfwps.pl\"
  1126. else
  1127. echo shar: Extracting \"fixwfwps.pl\" \(500 characters\)
  1128. sed "s/^X//" >fixwfwps.pl <<'END_OF_fixwfwps.pl'
  1129. X#!@PERL@
  1130. X# fixwfwps: fix Word for windows PostScript for printing.
  1131. X
  1132. X# feed this into perl
  1133. Xeval 'exec perl -S $0 "$@"'
  1134. X   if $running_under_some_shell;
  1135. X
  1136. Xwhile (<>) {
  1137. X   tr/\000-\011\013-\037//d;
  1138. X   s!/SVDoc\s+save\s+def!!g;
  1139. X   s!SVDoc\s+restore!!g;
  1140. X   if (/^(%!PS-Adobe-\d*\.\d*) EPSF-/) {
  1141. X      print "$1\n";
  1142. X      $wfwepsf = 1;
  1143. X   } elsif (/^SS\s*$/ && $wfwepsf) {
  1144. X      print "%%Page: $wfwepsf $wfwepsf\n";
  1145. X      $wfwepsf++;
  1146. X      print $_;
  1147. X   } elsif (! /^%%BoundingBox/) {
  1148. X      print $_;
  1149. X   }
  1150. X}
  1151. END_OF_fixwfwps.pl
  1152. if test 500 -ne `wc -c <fixwfwps.pl`; then
  1153.     echo shar: \"fixwfwps.pl\" unpacked with wrong size!
  1154. fi
  1155. # end of overwriting check
  1156. fi
  1157. if test -f fixwpps.man -a "${1}" != "-c" ; then 
  1158.   echo shar: Will not over-write existing file \"fixwpps.man\"
  1159. else
  1160. echo shar: Extracting \"fixwpps.man\" \(467 characters\)
  1161. sed "s/^X//" >fixwpps.man <<'END_OF_fixwpps.man'
  1162. X.TH FIXWPPS 1 "PSUtils Release @REL@ Patchlevel @PL@"
  1163. X.SH NAME
  1164. Xfixwpps \- filter to fix WP documents so PSUtils work
  1165. X.SH SYNOPSIS
  1166. X.B fixwpps 
  1167. X< 
  1168. X.I WordPerfect.ps
  1169. X>
  1170. X.I Fixed.ps
  1171. X.SH DESCRIPTION
  1172. X.I Fixwpps
  1173. Xis a 
  1174. X.I perl 
  1175. Xfilter which "fixes" PostScript from WordPerfect 5.0 and 5.1 so
  1176. Xthat it works correctly with Angus Duggan's
  1177. X.B psutils
  1178. Xpackage.
  1179. X.SH AUTHOR
  1180. XAngus Duggan
  1181. X.SH "SEE ALSO"
  1182. X@MAN@
  1183. X.SH TRADEMARKS
  1184. X.B PostScript
  1185. Xis a trademark of Adobe Systems Incorporated.
  1186. END_OF_fixwpps.man
  1187. if test 467 -ne `wc -c <fixwpps.man`; then
  1188.     echo shar: \"fixwpps.man\" unpacked with wrong size!
  1189. fi
  1190. # end of overwriting check
  1191. fi
  1192. if test -f fixwpps.pl -a "${1}" != "-c" ; then 
  1193.   echo shar: Will not over-write existing file \"fixwpps.pl\"
  1194. else
  1195. echo shar: Extracting \"fixwpps.pl\" \(669 characters\)
  1196. sed "s/^X//" >fixwpps.pl <<'END_OF_fixwpps.pl'
  1197. X#!@PERL@
  1198. X# fixwpps: get semi-conforming PostScript out of WordPerfect 5.0 file
  1199. X
  1200. X# feed this into perl
  1201. Xeval 'exec perl -S $0 "$@"'
  1202. X   if $running_under_some_shell;
  1203. X
  1204. X$page = 1;
  1205. X$nesting = 0;
  1206. X
  1207. Xwhile (<>) {
  1208. X   s/([^\/]_t)([0-9]+)/\1 \2/g;    # fix wp 5.0 bug
  1209. X   if (m!/_[be][dp]! || m!_bp \d+ \d+ roll!) {
  1210. X      print $_;
  1211. X   } elsif (/^(.*)(_bp.*)$/) {
  1212. X      print "$1\n" if $1 ne "";
  1213. X      print "%%Page: $page $page\n";
  1214. X      print "$2\n";
  1215. X      $page++;
  1216. X      $nesting++;
  1217. X   } elsif (/_ep$/) {
  1218. X      print $_;
  1219. X      $nesting--;
  1220. X   } elsif (/^(.*)(_ed.*)/) {
  1221. X      print "$1\n" if $1 ne "";
  1222. X      print "%%Trailer:\n";
  1223. X      print "$2\n";
  1224. X   } else {
  1225. X      print $_;
  1226. X   }
  1227. X}
  1228. END_OF_fixwpps.pl
  1229. if test 669 -ne `wc -c <fixwpps.pl`; then
  1230.     echo shar: \"fixwpps.pl\" unpacked with wrong size!
  1231. fi
  1232. # end of overwriting check
  1233. fi
  1234. if test -f fixwwps.man -a "${1}" != "-c" ; then 
  1235.   echo shar: Will not over-write existing file \"fixwwps.man\"
  1236. else
  1237. echo shar: Extracting \"fixwwps.man\" \(465 characters\)
  1238. sed "s/^X//" >fixwwps.man <<'END_OF_fixwwps.man'
  1239. X.TH FIXWWPS 1 "PSUtils Release @REL@ Patchlevel @PL@"
  1240. X.SH NAME
  1241. Xfixwwps \- filter to fix Windows Write documents so PSUtils work
  1242. X.SH SYNOPSIS
  1243. X.B fixwwps 
  1244. X< 
  1245. X.I WinWrite.ps
  1246. X>
  1247. X.I Fixed.ps
  1248. X.SH DESCRIPTION
  1249. X.I Fixwwps
  1250. Xis a 
  1251. X.I perl 
  1252. Xfilter which "fixes" PostScript from Windows Write so
  1253. Xthat it works correctly with Angus Duggan's
  1254. X.B psutils
  1255. Xpackage.
  1256. X.SH AUTHOR
  1257. XAngus Duggan
  1258. X.SH "SEE ALSO"
  1259. X@MAN@
  1260. X.SH TRADEMARKS
  1261. X.B PostScript
  1262. Xis a trademark of Adobe Systems Incorporated.
  1263. END_OF_fixwwps.man
  1264. if test 465 -ne `wc -c <fixwwps.man`; then
  1265.     echo shar: \"fixwwps.man\" unpacked with wrong size!
  1266. fi
  1267. # end of overwriting check
  1268. fi
  1269. if test -f fixwwps.pl -a "${1}" != "-c" ; then 
  1270.   echo shar: Will not over-write existing file \"fixwwps.pl\"
  1271. else
  1272. echo shar: Extracting \"fixwwps.pl\" \(364 characters\)
  1273. sed "s/^X//" >fixwwps.pl <<'END_OF_fixwwps.pl'
  1274. X#!@PERL@
  1275. X# fixwwps: get semi-conforming PostScript out of Windows Write file
  1276. X
  1277. X# feed this into perl
  1278. Xeval 'exec perl -S $0 "$@"'
  1279. X   if $running_under_some_shell;
  1280. X
  1281. X$page = 1;
  1282. X
  1283. Xwhile (<>) {
  1284. X   if (/^(%!.*) EPSF-\d.\d/) {
  1285. X      print $1, "\n";
  1286. X   } elsif (/^SS/) {
  1287. X      print "%%Page: $page $page\n";
  1288. X      print $_;
  1289. X      $page++;
  1290. X   } else {
  1291. X      print $_;
  1292. X   }
  1293. X}
  1294. END_OF_fixwwps.pl
  1295. if test 364 -ne `wc -c <fixwwps.pl`; then
  1296.     echo shar: \"fixwwps.pl\" unpacked with wrong size!
  1297. fi
  1298. # end of overwriting check
  1299. fi
  1300. if test -f getafm.man -a "${1}" != "-c" ; then 
  1301.   echo shar: Will not over-write existing file \"getafm.man\"
  1302. else
  1303. echo shar: Extracting \"getafm.man\" \(702 characters\)
  1304. sed "s/^X//" >getafm.man <<'END_OF_getafm.man'
  1305. X.TH GETAFM 1 "PSUtils Release @REL@ Patchlevel @PL@"
  1306. X.SH NAME
  1307. Xgetafm \- create an AFM file for a PostScript font.
  1308. X.SH SYNOPSIS
  1309. X.B getafm 
  1310. X.I FontName
  1311. X>
  1312. X.I fontname.afm
  1313. X.SH DESCRIPTION
  1314. X.I Getafm
  1315. Xgenerates a PostScript file which prints an AFM file for a font to the
  1316. Xprinter's output channel. The output of
  1317. X.I getafm
  1318. Xshould be sent to a printer, or to GhostScript. For example,
  1319. X.sp
  1320. X.ce
  1321. Xgetafm Times-Roman | gsnd - >Times-Roman.afm
  1322. X.sp
  1323. X.SH AUTHOR
  1324. XRobert Joop (rj@rainbow.in-berlin.de), Angus Duggan
  1325. X.SH "SEE ALSO"
  1326. X@MAN@
  1327. X.SH TRADEMARKS
  1328. X.B PostScript
  1329. Xis a trademark of Adobe Systems Incorporated.
  1330. X.SH BUGS
  1331. XKerning information is not generated by
  1332. X.I getafm;
  1333. Xit is best to use original AFM files if possible.
  1334. END_OF_getafm.man
  1335. if test 702 -ne `wc -c <getafm.man`; then
  1336.     echo shar: \"getafm.man\" unpacked with wrong size!
  1337. fi
  1338. # end of overwriting check
  1339. fi
  1340. if test -f patchlevel.h -a "${1}" != "-c" ; then 
  1341.   echo shar: Will not over-write existing file \"patchlevel.h\"
  1342. else
  1343. echo shar: Extracting \"patchlevel.h\" \(40 characters\)
  1344. sed "s/^X//" >patchlevel.h <<'END_OF_patchlevel.h'
  1345. X#define RELEASE 1
  1346. X#define PATCHLEVEL 12
  1347. END_OF_patchlevel.h
  1348. if test 40 -ne `wc -c <patchlevel.h`; then
  1349.     echo shar: \"patchlevel.h\" unpacked with wrong size!
  1350. fi
  1351. # end of overwriting check
  1352. fi
  1353. if test -f psbook.c -a "${1}" != "-c" ; then 
  1354.   echo shar: Will not over-write existing file \"psbook.c\"
  1355. else
  1356. echo shar: Extracting \"psbook.c\" \(2155 characters\)
  1357. sed "s/^X//" >psbook.c <<'END_OF_psbook.c'
  1358. X/* psbook.c
  1359. X * AJCD 27/1/91
  1360. X * rearrange pages in conforming PS file for printing in signatures
  1361. X *
  1362. X * Usage:
  1363. X *       psbook [-q] [-s<signature>] [infile [outfile]]
  1364. X */
  1365. X
  1366. X#include "psutil.h"
  1367. X#include "patchlevel.h"
  1368. X
  1369. Xvoid usage()
  1370. X{
  1371. X   fprintf(stderr, "%s release %d patchlevel %d\n", prog, RELEASE, PATCHLEVEL);
  1372. X   fprintf(stderr, "Usage: %s [-q] [-s<signature>] [infile [outfile]]\n",
  1373. X       prog);
  1374. X   fprintf(stderr, "       <signature> must be positive and divisible by 4\n");
  1375. X   fflush(stderr);
  1376. X   exit(1);
  1377. X}
  1378. X
  1379. X
  1380. Xmain(argc, argv)
  1381. X     int argc;
  1382. X     char *argv[];
  1383. X{
  1384. X   int signature = 0;
  1385. X   int currentpg, maxpage;
  1386. X
  1387. X   infile = stdin;
  1388. X   outfile = stdout;
  1389. X   verbose = 1;
  1390. X   for (prog = *argv++; --argc; argv++) {
  1391. X      if (argv[0][0] == '-') {
  1392. X     switch (argv[0][1]) {
  1393. X     case 's':    /* signature size */
  1394. X        signature = atoi(*argv+2);
  1395. X        if (signature < 1 || signature % 4) usage();
  1396. X        break;
  1397. X     case 'q':    /* quiet */
  1398. X        verbose = 0;
  1399. X        break;
  1400. X     case 'v':    /* version */
  1401. X     default:
  1402. X        usage();
  1403. X     }
  1404. X      } else if (infile == stdin) {
  1405. X     if ((infile = fopen(*argv, "r")) == NULL) {
  1406. X        fprintf(stderr, "%s: can't open input file %s\n", prog, *argv);
  1407. X        fflush(stderr);
  1408. X        exit(1);
  1409. X     }
  1410. X      } else if (outfile == stdout) {
  1411. X     if ((outfile = fopen(*argv, "w")) == NULL) {
  1412. X        fprintf(stderr, "%s: can't open output file %s\n", prog, *argv);
  1413. X        fflush(stderr);
  1414. X        exit(1);
  1415. X     }
  1416. X      } else usage();
  1417. X   }
  1418. X   if ((infile=seekable(infile))==NULL) {
  1419. X      fprintf(stderr, "%s: can't seek input\n", prog);
  1420. X      fflush(stderr);
  1421. X      exit(1);
  1422. X   }
  1423. X   scanpages();
  1424. X
  1425. X   maxpage = pages+(4-pages%4)%4;
  1426. X
  1427. X   if (!signature)
  1428. X      signature = maxpage;
  1429. X
  1430. X   /* rearrange pages */
  1431. X   writeheader(maxpage);
  1432. X   writeprolog("");
  1433. X   for (currentpg = 0; currentpg < maxpage; currentpg++) {
  1434. X      int actualpg = currentpg - currentpg%signature;
  1435. X      switch(currentpg%4) {
  1436. X      case 0:
  1437. X      case 3:
  1438. X     actualpg += signature-1-(currentpg%signature)/2;
  1439. X     break;
  1440. X      case 1:
  1441. X      case 2:
  1442. X     actualpg += (currentpg%signature)/2;
  1443. X     break;
  1444. X      }
  1445. X      if (actualpg < pages)
  1446. X     writepage(actualpg);
  1447. X      else
  1448. X     writeemptypage();
  1449. X   }
  1450. X   writetrailer();
  1451. X
  1452. X   exit(0);
  1453. X}
  1454. END_OF_psbook.c
  1455. if test 2155 -ne `wc -c <psbook.c`; then
  1456.     echo shar: \"psbook.c\" unpacked with wrong size!
  1457. fi
  1458. # end of overwriting check
  1459. fi
  1460. if test -f psbook.man -a "${1}" != "-c" ; then 
  1461.   echo shar: Will not over-write existing file \"psbook.man\"
  1462. else
  1463. echo shar: Extracting \"psbook.man\" \(1072 characters\)
  1464. sed "s/^X//" >psbook.man <<'END_OF_psbook.man'
  1465. X.TH PSBOOK 1 "PSUtils Release @REL@ Patchlevel @PL@"
  1466. X.SH NAME
  1467. Xpsbook \- rearrange pages in PostScript file into signatures
  1468. X.SH SYNOPSIS
  1469. X.B psbook
  1470. X[
  1471. X.B \-q
  1472. X] [
  1473. X.B \-s\fIsignature\fR
  1474. X] [
  1475. X.I infile
  1476. X[
  1477. X.I outfile
  1478. X] ]
  1479. X.SH DESCRIPTION
  1480. X.I Psbook
  1481. Xrearranges pages from a PostScript document into ``signatures'' for
  1482. Xprinting books or booklets, creating a new PostScript file. The
  1483. Xinput PostScript file should follow the Adobe Document Structuring
  1484. XConventions.
  1485. X.PP
  1486. XThe
  1487. X.I \-s
  1488. Xoption selects the size of signature which will be used. The signature size is
  1489. Xthe number of sides which will be folded and bound together; the number given
  1490. Xshould be a multiple of four. The default is to use one signature for the
  1491. Xwhole file. Extra blank sides will be added if the file does not contain a
  1492. Xmultiple of four pages.
  1493. X.PP
  1494. XPsbook normally prints the page numbers of the pages rearranged; the
  1495. X.I \-q
  1496. Xoption suppresses this.
  1497. X.SH AUTHOR
  1498. XAngus Duggan
  1499. X.SH "SEE ALSO"
  1500. X@MAN@
  1501. X.SH TRADEMARKS
  1502. X.B PostScript
  1503. Xis a trademark of Adobe Systems Incorporated.
  1504. X.SH BUGS
  1505. X.I Psbook
  1506. Xdoes not accept all DSC comments.
  1507. END_OF_psbook.man
  1508. if test 1072 -ne `wc -c <psbook.man`; then
  1509.     echo shar: \"psbook.man\" unpacked with wrong size!
  1510. fi
  1511. # end of overwriting check
  1512. fi
  1513. if test -f psnup.man -a "${1}" != "-c" ; then 
  1514.   echo shar: Will not over-write existing file \"psnup.man\"
  1515. else
  1516. echo shar: Extracting \"psnup.man\" \(3454 characters\)
  1517. sed "s/^X//" >psnup.man <<'END_OF_psnup.man'
  1518. X.TH PSNUP 1 "PSUtils Release @REL@ Patchlevel @PL@"
  1519. X.SH NAME
  1520. Xpsnup \- multiple pages per sheet
  1521. X.SH SYNOPSIS
  1522. X.B psnup
  1523. X[
  1524. X.B \-w\fIwidth\fR
  1525. X] [
  1526. X.B \-h\fIheight\fR
  1527. X] [
  1528. X.B \-p\fIpaper\fR
  1529. X] [
  1530. X.B \-l
  1531. X] [
  1532. X.B \-r
  1533. X] [
  1534. X.B \-f
  1535. X] [
  1536. X.B \-c
  1537. X] [
  1538. X.B \-m\fImargin\fR
  1539. X] [
  1540. X.B \-b\fIborder\fR
  1541. X] [
  1542. X.B \-d\fIlwidth\fR
  1543. X] [
  1544. X.B \-s\fIscale\fR
  1545. X] [
  1546. X.B \-\fInup\fR
  1547. X] [
  1548. X.B \-q
  1549. X] [
  1550. X.I infile
  1551. X[
  1552. X.I outfile
  1553. X] ]
  1554. X.SH DESCRIPTION
  1555. X.I Psnup
  1556. Xputs multiple logical pages onto each physical sheet of paper.
  1557. XThe input PostScript file should follow the Adobe Document Structuring
  1558. XConventions.
  1559. X.PP
  1560. XThe
  1561. X.I \-w
  1562. Xoption gives the paper width, and the
  1563. X.I \-h
  1564. Xoption gives the paper height,
  1565. Xnormally specified in
  1566. X.B "cm"
  1567. Xor
  1568. X.B "in"
  1569. Xto convert 
  1570. XPostScript's points (1/72 of an inch)
  1571. Xto centimeters or inches.
  1572. XThe 
  1573. X.I \-p
  1574. Xoption can be used as an alternative, to set the paper size to
  1575. X.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto
  1576. Xor
  1577. X.B 10x14.
  1578. XThe default paper size is
  1579. X.B @PAPER@.
  1580. X.PP
  1581. XThe
  1582. X.I \-l
  1583. Xoption should be used for pages which are in landscape orientation (rotated 90
  1584. Xdegrees anticlockwise). The
  1585. X.I \-r
  1586. Xoption should be used for pages which are in seascape orientation (rotated 90
  1587. Xdegrees clockwise), and the
  1588. X.I \-f
  1589. Xoption should be used for pages which have the width and height interchanged,
  1590. Xbut are not rotated.
  1591. X.PP
  1592. X.I Psnup
  1593. Xnormally uses `row-major' layout, where adjacent pages are placed in rows
  1594. Xacross the paper.
  1595. XThe
  1596. X.I \-c
  1597. Xoption changes the order to `column-major', where successive pages are placed
  1598. Xin columns down the paper.
  1599. X.PP
  1600. XA margin to leave around the whole page can be specified with the
  1601. X.I \-m
  1602. Xoption. This is useful for sheets of `thumbnail' pages, because the normal
  1603. Xpage margins are reduced by putting multiple pages on a single sheet.
  1604. X.PP
  1605. XThe
  1606. X.I \-b
  1607. Xoption is used to specify an additional margin around each page on a sheet.
  1608. X.PP
  1609. XThe
  1610. X.I \-d
  1611. Xoption draws a line around the border of each page, of the specified width.
  1612. XIf the \fIlwidth\fR parameter is omitted, a default linewidth of 1 point is
  1613. Xassumed. The linewidth is relative to the original page dimensions,
  1614. X\fIi.e.\fR it is scaled down with the rest of the page.
  1615. X.PP
  1616. XThe scale chosen by
  1617. X.I psnup
  1618. Xcan be overridden with the
  1619. X.I \-s
  1620. Xoption. This is useful to merge pages which are already reduced.
  1621. X.PP
  1622. XThe
  1623. X.I \-\fInup\fR
  1624. Xoption selects the number of logical pages to put on each sheet of paper. This
  1625. Xcan be any whole number;
  1626. X.I psnup
  1627. Xtries to optimise the layout so that the minimum amount of space is wasted. If
  1628. X.I psnup
  1629. Xcannot find a layout within its tolerance limit, it will abort with an error
  1630. Xmessage.
  1631. X.PP
  1632. X.I Psnup
  1633. Xnormally prints the page numbers of the pages re-arranged; the
  1634. X.I \-q
  1635. Xoption suppresses this.
  1636. X.SH EXAMPLES
  1637. XThe potential use of this utility is varied but one particular 
  1638. Xuse is in conjunction with 
  1639. X.I psbook(1).
  1640. XFor example, using groff to create a PostScript document and lpr as 
  1641. Xthe 
  1642. X.SM UNIX 
  1643. Xprint spooler a typical command line might look like this: 
  1644. X.sp
  1645. Xgroff -Tps -ms \fIfile\fP | psbook | psnup -2 | lpr
  1646. X.sp
  1647. XWhere file is a 4 page document this command will result in a 
  1648. Xtwo page document printing two pages of \fIfile\fP per page and
  1649. Xrearranges the page order to match the input pages 4 and 1 
  1650. Xon the first output page and
  1651. Xpages 2 then 3 of the input document 
  1652. Xon the second output page.
  1653. X.SH AUTHOR
  1654. XAngus Duggan
  1655. X.SH "SEE ALSO"
  1656. X@MAN@
  1657. X.SH TRADEMARKS
  1658. X.B PostScript
  1659. Xis a trademark of Adobe Systems Incorporated.
  1660. X.SH BUGS
  1661. X.I Psnup
  1662. Xdoes not accept all DSC comments.
  1663. END_OF_psnup.man
  1664. if test 3454 -ne `wc -c <psnup.man`; then
  1665.     echo shar: \"psnup.man\" unpacked with wrong size!
  1666. fi
  1667. # end of overwriting check
  1668. fi
  1669. if test -f psselect.man -a "${1}" != "-c" ; then 
  1670.   echo shar: Will not over-write existing file \"psselect.man\"
  1671. else
  1672. echo shar: Extracting \"psselect.man\" \(1908 characters\)
  1673. sed "s/^X//" >psselect.man <<'END_OF_psselect.man'
  1674. X.TH PSSELECT 1 "PSUtils Release @REL@ Patchlevel @PL@"
  1675. X.SH NAME
  1676. Xpsselect \- select pages from a PostScript file
  1677. X.SH SYNOPSIS
  1678. X.B psselect
  1679. X[
  1680. X.B \-q
  1681. X] [
  1682. X.B \-e
  1683. X] [
  1684. X.B \-o
  1685. X] [
  1686. X.B \-r
  1687. X] [
  1688. X.B \-p\fIpages\fR
  1689. X] [
  1690. X.I pages
  1691. X] [
  1692. X.I infile
  1693. X[
  1694. X.I outfile
  1695. X] ]
  1696. X.SH DESCRIPTION
  1697. X.I Psselect
  1698. Xselects pages from a PostScript document, creating a new PostScript file. The
  1699. Xinput PostScript file should follow the Adobe Document Structuring
  1700. XConventions.
  1701. X.PP
  1702. XThe 
  1703. X.I \-e
  1704. Xoption selects all of the even pages; it may be used in conjunction with the
  1705. Xother page selection options to select the even pages from a range of pages.
  1706. X.PP
  1707. XThe 
  1708. X.I \-o
  1709. Xoption selects all of the odd pages; it may be used in conjunction with the
  1710. Xother page selection options.
  1711. X.PP
  1712. XThe 
  1713. X.I \-p\fIpages\fR
  1714. Xoption specifies the pages which are to be selected.
  1715. X.I Pages
  1716. Xis a comma separated list of page ranges, each of which may be a page number,
  1717. Xor a page range of the form \fIfirst\fR-\fIlast\fR. If \fIfirst\fR is omitted,
  1718. Xthe
  1719. Xfirst page is assumed, and if \fIlast\fR is omitted, the last page is assumed.
  1720. X
  1721. XThe prefix character `_' indicates that the page number is relative to the end
  1722. Xof the document, counting backwards.
  1723. X.PP
  1724. XThe 
  1725. X.I \-r
  1726. Xoption causes
  1727. X.I psselect
  1728. Xto output the selected pages in reverse order.
  1729. X.PP
  1730. XPsselect normally prints the page numbers of the pages rearranged; the
  1731. X.I \-q
  1732. Xoption suppresses this.
  1733. X.PP
  1734. XIf any of the
  1735. X.I \-r, \-e,
  1736. Xor
  1737. X.I \-o
  1738. Xoptions are specified, the page range must be given with the
  1739. X.I \-p
  1740. Xoption. This is for backwards compatibility with previous versions.
  1741. X
  1742. X.SH NOTES
  1743. XThe page number given to
  1744. X.I psselect
  1745. Xis the number of the page counting from the start or end of the file, starting
  1746. Xat one. The actual page number in the document may be different.
  1747. X.SH AUTHOR
  1748. XAngus Duggan
  1749. X.SH "SEE ALSO"
  1750. X@MAN@
  1751. X.SH TRADEMARKS
  1752. X.B PostScript
  1753. Xis a trademark of Adobe Systems Incorporated.
  1754. X.SH BUGS
  1755. X.I Psselect
  1756. Xdoes not accept all DSC comments.
  1757. END_OF_psselect.man
  1758. if test 1908 -ne `wc -c <psselect.man`; then
  1759.     echo shar: \"psselect.man\" unpacked with wrong size!
  1760. fi
  1761. # end of overwriting check
  1762. fi
  1763. if test -f psspec.h -a "${1}" != "-c" ; then 
  1764.   echo shar: Will not over-write existing file \"psspec.h\"
  1765. else
  1766. echo shar: Extracting \"psspec.h\" \(602 characters\)
  1767. sed "s/^X//" >psspec.h <<'END_OF_psspec.h'
  1768. X/* psspec.h
  1769. X * AJCD 5/6/93
  1770. X * routines for page rearrangement specs
  1771. X */
  1772. X
  1773. X#ifndef LOCAL
  1774. X#define LOCAL extern
  1775. X#endif
  1776. X
  1777. X/* pagespec flags */
  1778. X#define ADD_NEXT (0x01)
  1779. X#define ROTATE   (0x02)
  1780. X#define SCALE    (0x04)
  1781. X#define OFFSET   (0x08)
  1782. X#define GSAVE    (ROTATE|SCALE|OFFSET)
  1783. X
  1784. Xstruct pagespec {
  1785. X   int reversed, pageno, flags, rotate;
  1786. X   double xoff, yoff, scale;
  1787. X   struct pagespec *next;
  1788. X};
  1789. X
  1790. XLOCAL double width, height;
  1791. X
  1792. XLOCAL struct pagespec *newspec();
  1793. XLOCAL int parseint();
  1794. XLOCAL double parsedouble();
  1795. XLOCAL double parsedimen();
  1796. XLOCAL double singledimen();
  1797. XLOCAL void pstops();
  1798. X
  1799. Xextern double atof();
  1800. END_OF_psspec.h
  1801. if test 602 -ne `wc -c <psspec.h`; then
  1802.     echo shar: \"psspec.h\" unpacked with wrong size!
  1803. fi
  1804. # end of overwriting check
  1805. fi
  1806. if test -f pstops.man -a "${1}" != "-c" ; then 
  1807.   echo shar: Will not over-write existing file \"pstops.man\"
  1808. else
  1809. echo shar: Extracting \"pstops.man\" \(3883 characters\)
  1810. sed "s/^X//" >pstops.man <<'END_OF_pstops.man'
  1811. X.TH PSTOPS 1 "PSUtils Release @REL@ Patchlevel @PL@"
  1812. X.SH NAME
  1813. Xpstops \- shuffle pages in a PostScript file
  1814. X.SH SYNOPSIS
  1815. X.B pstops
  1816. X[
  1817. X.B \-q
  1818. X] [
  1819. X.B \-b
  1820. X] [
  1821. X.B \-w\fIwidth\fR
  1822. X] [
  1823. X.B \-h\fIheight\fR
  1824. X] [
  1825. X.B \-p\fIpaper\fR
  1826. X] [
  1827. X.B \-d\fIlwidth\fR
  1828. X]
  1829. X.I pagespecs
  1830. X[
  1831. X.I infile
  1832. X[
  1833. X.I outfile
  1834. X] ]
  1835. X.SH DESCRIPTION
  1836. X.I Pstops
  1837. Xrearranges pages from a PostScript document, creating a new PostScript file.
  1838. XThe input PostScript file should follow the Adobe Document Structuring
  1839. XConventions.
  1840. X.I Pstops
  1841. Xcan be used to perform a large number of arbitrary re-arrangements of
  1842. XDocuments, including arranging for printing 2-up, 4-up, booklets, reversing,
  1843. Xselecting front or back sides of documents, scaling, etc.
  1844. X.PP
  1845. X.I pagespecs
  1846. Xfollow the syntax:
  1847. X.RS
  1848. X.TP 12
  1849. X.I pagespecs
  1850. X.I = [modulo:]specs
  1851. X.TP
  1852. X.I specs
  1853. X.I = spec[+specs][,specs]
  1854. X.TP
  1855. X.I spec
  1856. X.I = [-]pageno[L][R][U][@scale][(xoff,yoff)]
  1857. X.RE
  1858. X.sp
  1859. X.I modulo
  1860. Xis the number of pages in each block. The value of
  1861. X.I modulo
  1862. Xshould be greater than 0; the default value is 1.
  1863. X.I specs
  1864. Xare the page specifications for the pages in each block. The value of the
  1865. X.I pageno
  1866. Xin each
  1867. X.I spec
  1868. Xshould be between 0 (for the first page in the block) and \fImodulo\fR-1
  1869. X(for the last page in each block) inclusive.
  1870. XThe optional dimensions
  1871. X.I xoff
  1872. Xand
  1873. X.I yoff
  1874. Xshift the page by the specified amount.
  1875. X.I xoff
  1876. Xand
  1877. X.I yoff
  1878. Xare in PostScript's points, but may be followed by the units
  1879. X.B "cm"
  1880. Xor
  1881. X.B "in"
  1882. Xto convert to centimetres or inches, or the flag
  1883. X.B "w"
  1884. Xor
  1885. X.B "h"
  1886. Xto specify as a multiple of the width or height.
  1887. XThe optional parameters \fIL\fR, \fIR\fR, and \fIU\fR rotate the page left,
  1888. Xright, or upside-down.
  1889. XThe optional
  1890. X.I scale
  1891. Xparameter scales the page by the fraction specified.
  1892. XIf the optional minus sign is specified, the page is relative to the end of
  1893. Xthe document, instead of the start.
  1894. X
  1895. XIf page \fIspec\fRs are separated by
  1896. X.B \+
  1897. Xthe pages will be merged into one page; if they are separated by
  1898. X.B \,
  1899. Xthey will be on separate pages.
  1900. XIf there is only one page specification, with
  1901. X.I pageno
  1902. Xzero, the \fIpageno\fR may be omitted.
  1903. X
  1904. XThe shift, rotation, and scaling are performed
  1905. Xin that order regardless of which order
  1906. Xthey appear on the command line.
  1907. X.PP
  1908. XThe
  1909. X.I \-w
  1910. Xoption gives the width which is used by the
  1911. X.B "w"
  1912. Xdimension specifier, and the
  1913. X.I \-h
  1914. Xoption gives the height which is used by the
  1915. X.B "h"
  1916. Xdimension specifier. These dimensions are also used (after scaling) to set the
  1917. Xclipping path for each page.
  1918. XThe 
  1919. X.I \-p
  1920. Xoption can be used as an alternative, to set the paper size to
  1921. X.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto
  1922. Xor
  1923. X.B 10x14.
  1924. XThe default paper size is
  1925. X.B @PAPER@.
  1926. X.PP
  1927. XThe
  1928. X.I \-b
  1929. Xoption prevents any
  1930. X.B bind
  1931. Xoperators in the PostScript prolog from binding. This may be needed in cases
  1932. Xwhere complex multi-page re-arrangements are being done.
  1933. X.PP
  1934. XThe
  1935. X.I \-d
  1936. Xoption draws a line around the border of each page, of the specified width.
  1937. XIf the \fIlwidth\fR parameter is omitted, a default linewidth of 1 point is
  1938. Xassumed. The linewidth is relative to the original page dimensions,
  1939. X\fIi.e.\fR it is scaled up or down with the rest of the page.
  1940. X.PP
  1941. XPstops normally prints the page numbers of the pages re-arranged; the
  1942. X.I \-q
  1943. Xoption suppresses this.
  1944. X.SH EXAMPLES
  1945. XThis section contains some sample re-arrangements. To put two pages on one
  1946. Xsheet (of A4 paper), the pagespec to use is:
  1947. X.sp
  1948. X.ce
  1949. X2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)
  1950. X.sp
  1951. XTo select all of the odd pages in reverse order, use:
  1952. X.sp
  1953. X.ce
  1954. X2:-0
  1955. X.sp
  1956. XTo re-arrange pages for printing 2-up booklets, use
  1957. X.sp
  1958. X.ce
  1959. X4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm)
  1960. X.sp
  1961. Xfor the front sides, and
  1962. X.sp
  1963. X.ce
  1964. X4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm)
  1965. X.sp
  1966. Xfor the reverse sides (or join them with a comma for duplex printing).
  1967. X.SH AUTHOR
  1968. XAngus Duggan
  1969. X.SH "SEE ALSO"
  1970. X@MAN@
  1971. X.SH TRADEMARKS
  1972. X.B PostScript
  1973. Xis a trademark of Adobe Systems Incorporated.
  1974. X.SH BUGS
  1975. X.I Pstops
  1976. Xdoes not accept all DSC comments.
  1977. END_OF_pstops.man
  1978. if test 3883 -ne `wc -c <pstops.man`; then
  1979.     echo shar: \"pstops.man\" unpacked with wrong size!
  1980. fi
  1981. # end of overwriting check
  1982. fi
  1983. if test -f psutil.h -a "${1}" != "-c" ; then 
  1984.   echo shar: Will not over-write existing file \"psutil.h\"
  1985. else
  1986. echo shar: Extracting \"psutil.h\" \(988 characters\)
  1987. sed "s/^X//" >psutil.h <<'END_OF_psutil.h'
  1988. X/* psutil.h
  1989. X * AJCD 29/1/91
  1990. X * utilities for PS programs
  1991. X */
  1992. X
  1993. X#include <stdio.h>
  1994. X#include <ctype.h>
  1995. X
  1996. X#ifndef LOCAL
  1997. X#define LOCAL extern
  1998. X#endif
  1999. X
  2000. X#define TMPDIR "/tmp"
  2001. X
  2002. X/* paper size structure; configurability and proper paper resources will have
  2003. X   to wait until version 2 */
  2004. Xstruct papersize {
  2005. X   char *name;        /* name of paper size */
  2006. X   int width, height;    /* width, height in points */
  2007. X};
  2008. X
  2009. XLOCAL char *prog;
  2010. XLOCAL int pages;
  2011. XLOCAL int verbose;
  2012. XLOCAL FILE *infile;
  2013. XLOCAL FILE *outfile;
  2014. XLOCAL char pagelabel[BUFSIZ];
  2015. XLOCAL int pageno;
  2016. X
  2017. XLOCAL struct papersize *findpaper();
  2018. XLOCAL FILE *seekable();
  2019. XLOCAL void writepage();
  2020. XLOCAL void seekpage();
  2021. XLOCAL void writepageheader();
  2022. XLOCAL void writepagebody();
  2023. XLOCAL void writeheader();
  2024. XLOCAL void writeprolog();
  2025. XLOCAL void writetrailer();
  2026. XLOCAL void writeemptypage();
  2027. XLOCAL void scanpages();
  2028. XLOCAL void writestring();
  2029. XLOCAL void message();
  2030. X
  2031. Xextern long lseek();
  2032. Xextern long ftell();
  2033. Xextern char *getenv();
  2034. X#ifdef VMS
  2035. X#define unlink delete
  2036. X#endif
  2037. X
  2038. END_OF_psutil.h
  2039. if test 988 -ne `wc -c <psutil.h`; then
  2040.     echo shar: \"psutil.h\" unpacked with wrong size!
  2041. fi
  2042. # end of overwriting check
  2043. fi
  2044. if test -f showchar -a "${1}" != "-c" ; then 
  2045.   echo shar: Will not over-write existing file \"showchar\"
  2046. else
  2047. echo shar: Extracting \"showchar\" \(2567 characters\)
  2048. sed "s/^X//" >showchar <<'END_OF_showchar'
  2049. X#!/bin/sh
  2050. X# showchar: show character with information
  2051. X# usage:
  2052. X#       showchar Font-Name Char-Name | lpr -Pprinter
  2053. X
  2054. Xif [ $# != 2 ]; then
  2055. X        echo "Usage: `basename $0` Font-Name Char-Name" >&2
  2056. X        exit 1
  2057. Xfi
  2058. X
  2059. Xcat <<EOF
  2060. X%!
  2061. X% Get character metrics and bounding box for $1
  2062. X/ns 30 string def
  2063. X/fname /$1 def
  2064. X/cname /$2 def
  2065. X/fn fname findfont 1000 scalefont def
  2066. X/thin 0.7 def
  2067. X/reduction 2.0 def
  2068. X
  2069. X/sn { ns cvs show } def
  2070. X/sc { (\()show exch sn (,)show sn (\))show } def
  2071. X
  2072. X/Times-Roman findfont 10 scalefont setfont
  2073. X
  2074. X72 242 translate % one inch in, 3 1/2 inch up
  2075. Xnewpath 0 0 moveto
  2076. Xgsave   % print character name
  2077. X   0 468 rmoveto
  2078. X   ($2 from font $1 displayed on `date` by `basename $0` 1.00 (C) AJCD 1991)
  2079. X   show 
  2080. Xgrestore
  2081. X
  2082. Xgsave
  2083. X   thin setlinewidth  % cross hairs
  2084. X   -9 0 rmoveto 18 0 rlineto
  2085. X   -9 -9 rmoveto 0 18 rlineto
  2086. X   stroke  % position info
  2087. X   -9 -9 moveto ((0,0)) stringwidth pop neg 0 rmoveto
  2088. X   ((0,0)) show
  2089. Xgrestore
  2090. X
  2091. X% create encoding with a single character at all positions
  2092. X/MyEncoding 256 array def
  2093. X
  2094. X0 1 255 { % fill out with notdefs
  2095. X   MyEncoding exch cname put
  2096. X} for
  2097. X
  2098. Xfn dup length dict begin
  2099. X  {1 index /FID ne {def} {pop pop} ifelse} forall
  2100. X  /Encoding MyEncoding def
  2101. X  currentdict
  2102. Xend /newfont exch definefont
  2103. X/fn exch def
  2104. X/en MyEncoding def
  2105. X
  2106. Xgsave  % draw character (enlarged)
  2107. X  .75 setgray
  2108. X  fn 1 reduction div scalefont setfont
  2109. X  (\000) show
  2110. Xgrestore
  2111. X
  2112. X% show character info
  2113. Xfn /Metrics known {
  2114. X   dup fn /Metrics get exch get 
  2115. X   dup type /arraytype eq {
  2116. X      dup length 2 eq
  2117. X      {1 get 0} {dup 2 get exch 3 get} ifelse
  2118. X   } {
  2119. X      round 0
  2120. X   } ifelse
  2121. X} {
  2122. X   gsave
  2123. X      fn setfont (\000) stringwidth round exch round exch
  2124. X   grestore
  2125. X} ifelse
  2126. Xgsave   % show width
  2127. X   thin setlinewidth
  2128. X   2 copy
  2129. X   reduction div exch reduction div exch rlineto
  2130. X   gsave
  2131. X      1 1 rmoveto sc
  2132. X   grestore
  2133. X   -4 -3 rlineto 0 6 rmoveto 4 -3 rlineto
  2134. X   stroke
  2135. Xgrestore
  2136. X
  2137. Xgsave
  2138. X   gsave  % get bounding box
  2139. X      fn setfont
  2140. X      (\000) true charpath flattenpath pathbbox
  2141. X   grestore
  2142. X   thin setlinewidth
  2143. X   3 index reduction div  % put coords on top of stack
  2144. X   3 index reduction div
  2145. X   3 index reduction div
  2146. X   3 index reduction div
  2147. X   3 index 3 index moveto
  2148. X   gsave  % llx lly
  2149. X      0 -9 rmoveto 7 index 7 index sc
  2150. X   grestore
  2151. X   1 index 3 index lineto
  2152. X   gsave  % urx lly
  2153. X      0 -9 rmoveto 5 index 7 index sc
  2154. X   grestore
  2155. X   1 index 1 index lineto
  2156. X   gsave  % urx ury
  2157. X      0 9 rmoveto 5 index 5 index sc
  2158. X   grestore
  2159. X   3 index 1 index lineto
  2160. X   gsave  % llx ury
  2161. X      0 9 rmoveto 7 index 5 index sc
  2162. X   grestore
  2163. X   closepath stroke
  2164. Xgrestore
  2165. Xshowpage
  2166. XEOF
  2167. END_OF_showchar
  2168. if test 2567 -ne `wc -c <showchar`; then
  2169.     echo shar: \"showchar\" unpacked with wrong size!
  2170. fi
  2171. chmod +x showchar
  2172. # end of overwriting check
  2173. fi
  2174. echo shar: End of archive 1 \(of 4\).
  2175. cp /dev/null ark1isdone
  2176. MISSING=""
  2177. for I in 1 2 3 4 ; do
  2178.     if test ! -f ark${I}isdone ; then
  2179.     MISSING="${MISSING} ${I}"
  2180.     fi
  2181. done
  2182. if test "${MISSING}" = "" ; then
  2183.     echo You have unpacked all 4 archives.
  2184.     rm -f ark[1-9]isdone
  2185. else
  2186.     echo You still need to unpack the following archives:
  2187.     echo "        " ${MISSING}
  2188. fi
  2189. ##  End of shell archive.
  2190. exit 0
  2191.  
  2192. exit 0 # Just in case...
  2193.