[ Combined Document ] | Contents | Previous | Next


How do I print from Emacs?

20.4

Please read Andrew's note on how to print from Emacs in 20.4. What you need to do depends upon how you connect your printer to your machine.

Tim Sherrill <sherritp@sagian.com> has a very informative page on 2-up (n-up) printing from Emacs.

Holger Mueller <hmueller@bigfoot.com> has taken over maintaining print-NT.el [V 1.15, 6/29/98] (previously maintained by Brian Gorka <gorkab@cyberpass.net>).

Theodore Jump <tjump@tertius.com> has also written w32-print.el, a relatively complete package for printing from Emacs on Windows systems (Postscript, plain-text, 2- and 4-up, 19.34.X and 20.X, UNC and local device paths, etc.). [V1.11, 12/7/98]

Pascal Obry has a nice example of how to set up some variables to get printing to work on NT.

Jeff Paquette <paquette@mediaone.net> has a version of pr for use with Emacs, and instructions on how to set it up.

Anders Lindgren <andersl@csd.uu.se> has written a lpr.bat batch file that can be subsituted transparently for lpr on NT (Windows 95 batch files don't redirect stdin correctly).

A number of other people have put together packages to print from Emacs. I haven't had the time to go through them and piece everything together, but I recommend that you flip through this collection of messages.

For info on 2-up printing from Emacs, take a look at these messages.

For clever tricks for specific printers, take a look at these messages.

Bill Carpenter on printing in color:

It's relatively easy to set up the ps-print package, which can
generate color PostScript output.  You can then run the results
through Ghostscript if you don't happen to have a color PS printer
laying around.

To try it manually, do something like this:

        (require 'ps-print)
        (ps-spool-buffer-with-faces)

and then look for the buffer "*PostScript*".

You can also turn your font-locked buffers into HTML, and then use a browser to print them out. See the section on htmlize.el.

Printing via Ghostscript

 Alec Clews reports success at using Ghostscript to perform his printing - using gsview version 3.4, and Ghostscript version 6.01

 The configuration is straightforward, here's his settings, (which you should modify to suit).

      (setq ps-lpr-command "c:\\Ghostgum\\gsview\\gsprint.exe")

      ;; THis line causes ghostscript to query which printer to
      ;; use - which you may not need if, for example, you only
      ;; have one printer.
      (setq ps-lpr-switches '("-query"))

      (setq ps-printer-name t)

 The commandline options are documented in the gsprint.htm file which comes with Ghostscript.

How do I print all these languages that Emacs is now displaying?

 Emacs 20.4 has the ability to print non Western languages in two ways. Both use the "Postscript Print" functions, so if you do not have a Postscript printer, you will need to configure Emacs to print through Ghostscript.

  1. Using built-in support in the printer (or in Ghostscript).
  2. Using BDF fonts.

The variable `ps-multibyte-buffer' controls how non-latin characters are printed. If you are using built in support in the printer or Ghostscript, then setting this variable appropriately is all that needs to be done. To use BDF fonts, you will need to tell ps-print where to find them. This is done by setting `bdf-directory-list'. For example:

(setq ps-multibyte-buffer 'bdf-font
      ps-mule-font-info-database ps-mule-font-info-database-bdf
      bdf-directory-list '("c:/intlfonts/European" "c:/intlfonts/Chinese"
                           "c:/intlfonts/Japanese" "c:/intlfonts/Korean-X"))

By default, Emacs uses 24 dot BDF fonts for normal text, 16 dot for bold and italic and 40 dot for some (uncommon) Chinese and Japanese character sets.

How do I print to a printer that is directly connected to a network?

 If you have a printer which doesn't require a print server and is just connected directly to a hub you may find this information useful - it was contributed by Ed Grissom <egrissom@ziimaging.com>

While there may be better ways to do this, I have used the solution below to solve this problem if other Win32 apps _can_ print to the printer (Like Word or Notepad ).

Go to the printer properties and "share" the printer from your machine.

Then tell Emacs the printer is \\yourmachine\yoursharename and it should work

 You may need more slashes or the opposite type of slash depending on which Emacs printing subsystem (i.e. lpr, ps-print, print-nt, w32-print, etc.) you are using. Just look at the subsystem's example for a networked printer, and substitute your machine name as the server and your share name as the printer name.


[ Combined Document ] | Contents | Previous | Next
Steve Kemp, FAQ Maintainer
<skx@tardis.ed.ac.uk>
Valid HTML 4.01!
Last Modified : Thursday 1 August 2002