[ESS] printing a file

Richard M. Heiberger rmh at temple.edu
Thu Jan 5 01:34:34 CET 2006


Printing is a problem because we are mostly using "Windows Printers".
That means that the printer is only capable of printing dots that the
software sends it.  It is not capable of printing streams of ascii
characters.

You therefore have two choices.
1. Use PostScript
   M-x ps-print-region
or
   M-x ps-print-buffer

You need the following settings in your .emacs
;; Use GhostScript to PostScript print files
(setenv "GS_LIB" "c:\\gs\\gs8.00;c:\\gs\\fonts")
(setq ps-lpr-command "c:/gs/gs8.00/bin/gswin32c")
(setq ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH" "-sDEVICE=mswinpr2"))
(setq ps-printer-name t)
(setq ps-print-header nil) ;; from ps-print.el

If you have gs newer than gs8.00, put the corresponding numbers in the above commands.



2. Run printing through Notepad.

;;; experiments with "notepad /p", based on S-Plus objprint()
(setq printer-name "")         ;; notepad takes the default
(setq lpr-command "notepad")   ;; notepad
(setq lpr-switches nil)        ;; not needed
(setq lpr-printer-switch "/P") ;; run notepad as batch printer
(setq lpr-headers-switches nil);; must turn this off




More information about the ESS-help mailing list