unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* basic question about printing
@ 2024-09-28 17:45 Francis
  2024-10-16 14:02 ` gfp
  0 siblings, 1 reply; 3+ messages in thread
From: Francis @ 2024-09-28 17:45 UTC (permalink / raw)
  To: 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.?

2.
How to change the first variable in that way,
that it prints only 1 column on a A4 page?
Now it prints 2 columns.

3.
at the moment I can't use the 3 variable printing through paps.

4.
the first and second variable are printing 2 columns.
How can I change that?

thanks
Gottfried


;;printer
(setq lpr-switches
       (append '("-P" "HP-Officejet-J4500-series"
                 "-o" "sides=two-sided-long-edge"
                 "-o" "number-up=2")
               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 (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)



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-19  5:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-28 17:45 basic question about printing Francis
2024-10-16 14:02 ` gfp
2024-10-19  5:44   ` Michael Heerdegen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).