Netscape 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. From: "Craig D. Miller" <Craig.D.Miller@jpl.nasa.gov>
  2. Hi,
  3. Steps to integrate antiword into NetScape 4.73 (should also work with earlier
  4. versions).
  5. Programs that launch from netscape must startup an X window to display their
  6. output (otherwise output ends up it the bit bucket on your system). I wrote the
  7. following script to do this for antiword (and saved it as
  8. "/usr/local/bin/xantiword":
  9. #!/bin/csh -f
  10. setenv FILE $1
  11. setenv NEWFILE ${FILE}.xantiword
  12. /usr/local/bin/antiword $FILE >&$NEWFILE
  13. /usr/bin/X11/xterm -title "$FILE (MS Word)" -e /usr/bsd/more $NEWFILE
  14. rm -f $NEWFILE
  15. The above script works, but may not be the best way to do it. If you come up
  16. with a more elegant solution, then please let me know.
  17. Next you'll have to tell netscape to execute the "/usr/local/bin/xantiword"
  18. script when word documents are clicked on. The easiest way to do this is to
  19. change the /usr/local/lib/netscape/mailcap netscape configuration file. For
  20. SGI version of netscape the following two lines are changed. For other versions
  21. of netscape, one should find similar lines or will need to add the new lines.
  22. Old lines (try to run SoftWindows, which is not installed on my system):
  23. application/x-dos_ms_word; /usr/local/lib/netscape/swinexec %s winword; \
  24. description="Microsoft Word-for-Windows Document";
  25. application/msword; /usr/local/lib/netscape/swinexec %s winword; \
  26. description="Microsoft Word-for-Windows Document";
  27. New lines (for antiword execution), which replace old lines on my system:
  28. application/x-dos_ms_word; /usr/local/bin/xantiword %s; \
  29. description="Microsoft Word-for-Windows Document";
  30. application/msword; /usr/local/bin/xantiword %s; \
  31. description="Microsoft Word-for-Windows Document";
  32. These changes can also be made via the netscape preferences, under
  33. Navigator/Applications, but then the changes would only be for the user that
  34. changed them. The above change to the mailcap file affects all users, which is
  35. what you'll usually want.
  36. Note that the above file paths may be different for your system. On our linux
  37. box, a quick search DID NOT show where the mailcap for netscape was stored, but
  38. I did find one in /etc/mailcap. I don't have time to experiment to see if this
  39. is the same one that netscape uses.
  40. If you have questions then please E-mail me.
  41. - Craig
  42. ===============================================================================
  43. From: "Craig D. Miller" <Craig.D.Miller@jpl.nasa.gov>
  44. Hi,
  45. I just discovered a program called "xless". It would actually be easier to use
  46. than my previous xterm/more solution. To use it change the
  47. "/usr/local/bin/xantiword" script to:
  48. #!/bin/csh -f
  49. setenv FILE $1
  50. /usr/local/bin/antiword $FILE | /usr/freeware/bin/xless \
  51. -title "$FILE (MS Word)" -geometry 100x60
  52. Note that one also needs to have xless installed. It can be found on the
  53. SGI Freeware Feb 1999 (or later) CD-ROM.
  54. - Craig
  55. ===============================================================================
  56. From: Bruno Crochet <bruno.crochet@pse.unige.ch>
  57. Hi!
  58. Another way to integrate antiword into netscape is to copy the following
  59. line in your .mailcap file :
  60. application/msword; ns="%s"\; nf="${ns}".ps\; antiword -pa4 "${ns}" >
  61. "${nf}"\; gv "${nf}"\; sleep 2 \; rm "${nf}"
  62. Bruno.
  63. ===============================================================================
  64. From: Andoni Zarate <azarate@saincotrafico.com>
  65. In order to view the file into netscape you can write the xantiword file
  66. like this:
  67. #!/bin/csh -f
  68. setenv FILE $1
  69. setenv NEWFILE ${FILE}.xantiword
  70. /usr/local/bin/antiword $FILE >&$NEWFILE
  71. netscape -remote 'openFile('$NEWFILE')'
  72. Andoni Zárate.
  73. ===============================================================================
  74. From: Evelyne Pinter <epinter@ptcs.ch>
  75. I include a script for netscape to see the document with ghostview.
  76. #!/bin/csh -f
  77. setenv FILE $1
  78. setenv NEWFILE ${FILE}.xantiword
  79. /usr/local/bin/antiword -pa4 $FILE >&$NEWFILE
  80. /usr/X11R6/bin/gv $NEWFILE
  81. rm -f $NEWFILE
  82. In netscape the application must be called like that
  83. "/usr/local/bin/xantiword %s"
  84. This is just a small change(done by Roger Luechinger) to the xantiword
  85. you included in the distribution 0.31
  86. Thanks
  87. SG E.M.S.P.
  88. ===============================================================================