home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / windows / openloo / 3451 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  3.1 KB

  1. Xref: sparky comp.windows.open-look:3451 comp.text.frame:2585
  2. Path: sparky!uunet!olivea!sgigate!odin!mips!swrinde!cs.utexas.edu!asuvax!ncar!ncar.ucar.edu!era
  3. From: era@ncar.ucar.edu (Ed Arnold)
  4. Newsgroups: comp.windows.open-look,comp.text.frame
  5. Subject: ps->raster conversion under OW3.0?
  6. Message-ID: <1992Aug13.210054.12438@ncar.ucar.edu>
  7. Date: 13 Aug 92 21:00:54 GMT
  8. Sender: news@ncar.ucar.edu (USENET Maintenance)
  9. Reply-To: era@ncar.ucar.edu (Ed Arnold)
  10. Organization: Nat'l Center for Atmospheric Research (NCAR); Boulder, CO
  11. Lines: 98
  12.  
  13. We have a user here who has been using a script he got off the net,
  14. along with OpenWindows, to convert postscript files to raster.  When
  15. we changed from OW2.0 to  OW3.0 (both under SunOS 4.1.1), the script
  16. would no longer work.  Specifically, it calls xnews, which issues the
  17. error message "dlopen: stub interception failed", then dumps core.
  18.  
  19. Anyone know why the script fails, or can anyone suggest another
  20. reliable way to do this?  The user would rather not use ghostscript.
  21. Please email to me, I will summarize if there is any response.
  22.  
  23. Here's the script that has started failing under OW3.0.  Thanks
  24. in advance for your help ...
  25. ---->8-----cut here----->8-----cut here----->8-----cut here----->8----
  26. #! /bin/sh
  27. # @(#)ps2bits 1.2 89/12/12
  28. # ps2bits - PostScript to Rasterfile converter.
  29. #
  30.  
  31. USAGE="Usage: `basename ${0}` [-in s] [-out s] [-dpi x y] [-size w h] [-color]"
  32. OUT="pspage"
  33. IN="%stdin"
  34. DPIX=72
  35. DPIY=72
  36. XSIZE=8.5
  37. YSIZE=11
  38. DEPTH=1
  39.  
  40. export OPENWINHOME XNEWSHOME LD_LIBRARY_PATH
  41.  
  42. OPENWINHOME="${OPENWINHOME-/usr/local/OpenWindows}"
  43. XNEWSHOME=${OPENWINHOME}
  44. LD_LIBRARY_PATH=${OPENWINHOME}/lib:/lib
  45.  
  46. if [ ! -f $OPENWINHOME/etc/NeWS/redbook.ps ]; then
  47.     echo "`basename $0`: xnews is not installed correctly in $OPENWINHOME" 1>&2
  48.     echo "    (set \$OPENWINHOME to where it is installed...)" 1>&2
  49.     exit 1
  50. fi
  51.  
  52. while [ ${#} -gt 0 ]; do
  53.     case "${1}" in
  54.     -color)    shift;
  55.         DEPTH=8
  56.     ;;
  57.     -out)    shift;
  58.         OUT=${1} shift
  59.     ;;
  60.     -in)    shift;
  61.         IN=${1} shift
  62.     ;;
  63.     -size)    shift;
  64.         XSIZE=${1} shift;
  65.         YSIZE=${1} shift
  66.     ;;
  67.     -dpi)    shift;
  68.         DPIX=${1} shift;
  69.         DPIY=${1} shift
  70.     ;;
  71.     *)    echo ${USAGE};
  72.         exit 0
  73.     ;;
  74.     esac
  75. done
  76.  
  77. $OPENWINHOME/bin/xnews -init "
  78.     /currentpacking false def
  79.     /setpacking { pop } def
  80.     (NeWS/basics.ps) (r) file cvx exec
  81.     (NeWS/redbook.ps) (r) file cvx exec
  82.  
  83.     500 dict begin    % start userdict
  84.     false setautobind
  85.     /bind {} def
  86.  
  87.     /showpage { copypage erasepage initgraphics } def
  88.     /_pageno 0 def
  89.     /copypage {
  90.         /_pageno _pageno 1 add store
  91.         (${OUT})
  92.         clippath writecanvas
  93.     } def
  94.  
  95.     ${DPIX} ${XSIZE} mul ${DPIY} ${YSIZE} mul ${DEPTH}
  96.     [ ${DPIX} 72 div 0 0 ${DPIY} 72 div neg 0 7 index ]
  97.     null buildimage setcanvas
  98.     erasepage initgraphics
  99.  
  100.     % hack for bug in folio initialization code.
  101.     /Courier findfont 10 scalefont setfont () stringwidth pop pop
  102.  
  103.     (${IN}) (r) file cvx exec
  104.     shutdownserver
  105. "
  106. ---->8-----cut here----->8-----cut here----->8-----cut here----->8----
  107. --
  108. Ed Arnold * NCAR * POB 3000, Boulder, CO 80307-3000 * 303-497-1253(voice)
  109. 303-497-{1298,1137}(fax) * internet: era@ncar.ucar.edu * bitnet: era@ncario
  110. compuserve: internet:era@ncar.ucar.edu
  111.