unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Francis <francis.pr@gmail.com>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: basic question about printing
Date: Sat, 28 Sep 2024 19:45:05 +0200	[thread overview]
Message-ID: <4ebe1ce7-07fc-5160-2c09-2aee53de8c88@gmail.com> (raw)

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)



             reply	other threads:[~2024-09-28 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-28 17:45 Francis [this message]
2024-10-16 14:02 ` basic question about printing gfp
2024-10-19  5:44   ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ebe1ce7-07fc-5160-2c09-2aee53de8c88@gmail.com \
    --to=francis.pr@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).