help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

basic question about printing


From: gfp
Subject: basic question about printing
Date: Wed, 16 Oct 2024 14:02:38 +0000

Sorry, I sent this email with my old email address,
may be therefore I didn't get an answer.

I was looking on the web for hours, but I didn't find help.
So I am writing to you.

Betreff: basic question about printing
Datum: Sat, 28 Sep 2024 19:45:05 +0200
Von: Francis <francis.pr@gmail.com>
An: help-gnu-emacs@gnu.org <help-gnu-emacs@gnu.org>

Hi,

I have now 3 variables in my init.el concerning printing.

a
setq lpr-switches

b
M-x ps-print-buffer

c
printing with paps

1.
Is it right that it takes the first one, if I print in using the menu bar and it disregards the others?

2.
How to change the variables in that way,
that it prints with more space on the left and right side?

and with smaller letters, because now they are too big?

3.
at the moment I can't print through paps.
What do I have to do that I can try to print with paps?

4.
because I am a newcomer in Emacs, what can I do,
so that if using the printing button on the menu bar gives me more options.


thanks for help

Gottfried


here my init.el file:

;;printer
(setq lpr-switches
      (append '("-P" "HP-Officejet-J4500-series"
                "-o" "sides=one-sided-long-edge"
                "-o" "number-up=1")
              lpr-switches))

;;print preview
 (setq ps-lpr-command "print_preview")

;;M-x ps-print-buffer or M-x ps-print-region to print to a PostScript printer 2 pages on an A4 paper
;; 2 column landscape size 7 prints column 0-78, lines 1 to 70
;;Now you can use ‘M-x ps-print-buffer’, ‘M-x ps-print-buffer-with-faces’, ‘M-x ps-print-region’, and ‘M-x ps-print-region-with-faces’. ;;Use the C-u prefix to save the PostScript code into a file instead of printing it.

    (setq ps-paper-type 'a4
          ps-font-size 7.0
          ps-print-header nil
          ps-landscape-mode t
          ps-number-of-columns 2)

;; printing with paps (recommended by Jean)
(defun rcd-command-output-from-input (program input &rest args)
"Return output string from PROGRAM with given INPUT string and optional ARGS."
  (let* ((output (with-temp-buffer
                   (insert input)
                   (apply #'call-process-region nil nil program t '(t nil) nil 
args)
                   (buffer-string))))
    output))

;;I am too often using landscape, you can adjust it for your needs.

(defun rcd-paps-process (text &optional format title &rest args)
  (let* ((format (or format "pdf"))
         (title (or title (buffer-name)))
         (length (length title))
         (max 45)
         (title (if (> length max) (substring title 0 max) title)))
(apply 'rcd-command-output-from-input "paps" text "--format" format "--landscape" "--title" title "--header" args)))

(defun string-to-file-force (string file)
"Prints string into file, matters not if file exists. Return FILE as file name."
  (with-temp-file file
    (insert string))
  file)


Attachment: OpenPGP_0xD9E413C6C4BB32CE.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]