27

The function ps-print-buffer-with-faces prints an Emacs buffer. Is there a way to print a frame with more than one buffer in it? I would like to print an Emacs calc frame both with the RPN stack and the trail buffer.

  • 7
    Why not just take a screenshot and print that if the entirety of what you want to print is visible on the screen? – Kaushal Modi May 14 '15 at 18:23
  • If you print it to file (PostScript), you could later use some program (for example Inkscape) to place the contents of both files next to each other. But this won't print the fringe / the rest of the chrome of the program. – wvxvw May 14 '15 at 21:37
  • 2
    @kaushalmodi Because a printed screenshot with text has terrible resolution. – Gilles May 27 '15 at 12:34
  • 1
    @Gilles Saving screencaps as .png instead of .jpg (very lossy) gives a good enough quality image for me ( example: i.imgur.com/NHcDP5h.png ). – Kaushal Modi May 27 '15 at 12:47
  • 2
    There is a package in Ubuntu/Debian called gtk-vector-screenshot. It produces PS/PDF/SVG screenshots for GTK3 applications. The Github repo is here: github.com/nomeata/gtk-vector-screenshot. An overview is here: joachim-breitner.de/blog/494-Better_PDF_screenshots_with_gtk_3. You would have to configure Emacs via ./configure --with-x-toolkit=gtk3. Caveat: I'm sorry to tell you that I could not get it working! Since it's packaged in Ubuntu, it was clearly working for someone at some point in time. If someone gets it working, please expand this comment as an answer. – Joe Corneli May 31 '15 at 10:20
0

Instead of trying to print a frame, you should create a new buffer whose contents are created from copies of what's in the two calc buffers.

  • Is the asker's Emacs running in an xterm or similar? If so, could we create an Emacs Lisp function to do the job. That should result in an acceptable answer. – D A Vincent Dec 28 '15 at 2:21
0

You can use hfyview from https://github.com/jwiegley/nxhtml/blob/master/util/hfyview.el. It constructs a html facsimile of the Emacs frame that you can print from your web browser.

  • On Emacs 25.1 hfyview-frame (the function needed here) fails with "Wrong type argument"). hfyview-buffer still works though. – halloleo Jun 29 '18 at 6:59

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.