From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Francis Newsgroups: gmane.emacs.help Subject: basic question about printing Date: Sat, 28 Sep 2024 19:45:05 +0200 Message-ID: <4ebe1ce7-07fc-5160-2c09-2aee53de8c88@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10280"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 29 09:01:44 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sunw8-0002aY-T9 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 29 Sep 2024 09:01:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sunvO-0008Tv-TM; Sun, 29 Sep 2024 03:00:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1subVJ-0004jL-EM for help-gnu-emacs@gnu.org; Sat, 28 Sep 2024 13:45:15 -0400 Original-Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1subVH-0000Fw-CP for help-gnu-emacs@gnu.org; Sat, 28 Sep 2024 13:45:12 -0400 Original-Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-37ccf0c0376so1752237f8f.3 for ; Sat, 28 Sep 2024 10:45:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727545509; x=1728150309; darn=gnu.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=4fgbaKVRDvYFpGuI8bTvYHUPQYKPkyewad9cGjzGBZg=; b=CqAdb6Db+eSyr9a71ll4mgX53IWmIQ+Yy3BjxU+K2BHbidNk/D/D6fQ/9XlElDsDC6 GjdOckwin+p6n30sJwQnzK1f4wMGvF8vq+Tcgg37UQPjDH6Mb7B8btCfzCv1Iwh8QeL2 VEGVHjqw9LrVlvBwk/5iwjqZHKxvxzcfKu7aGrDWy0M6VbAomRiOY1AJOcbho4npo6JL UQ9mSNJWPJqJCvm5JlPg3aCM1fbJLzI6U/5qc+oFFPr8PNp+mLc7NtkImJ6o0SxoWrNd /i/kggMw2LHI2oxwum2duN9M5BoO/4QGpGpEZ9TxRIgooORLKaPlvzMzj8f3u4GsF2xF FZ1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727545509; x=1728150309; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=4fgbaKVRDvYFpGuI8bTvYHUPQYKPkyewad9cGjzGBZg=; b=ZBQ3EoGWx0DzFodETOKP6NOt7mIpaT0eT7oY4MoJ3vqe6v0Mpvw1jZ2zCvHJl+Xke3 Uahf6zcQfB8MGqC5AK376xC+Af8QLOXuYZmRcPJdZPYSoe4mYeoOFxOIm4lE8zfX83wl 2pZpwyvMPbrsLzIJrHs01zJ/8HdxEqJQgNsMO3yAxLFNk6pLIIRe6eJMJlhVZjCskQUD qC4ZNwfTzAAkM5CSatZpUd4TdXd+LIw7W1Ykl1pPjp0BdZKWGB7PEu9eRy4GVFipwjro OQ8HCSoIQwE+lpRrIR3/UbAKHLg+BKtz2j+3LoT9z563tAsGcRzQsFvs1qqaN6SOUoql w+3g== X-Gm-Message-State: AOJu0YzrHLEp37aVfAO+nv6mddfEbzfVta0P5hGQnwQXkiDW/+UGZcgJ 3o5g3zOOkcLcvP3osDkvRe/BmvygVzZOe7WtZHzE1aNGnUpBJDQDE7ee X-Google-Smtp-Source: AGHT+IEIJHo7aIm43QcyBLRlFWJxYooPGlbH8lgXnm66fK4QP7l3h3dkghqXPG7brvq2HQOGpnBsWQ== X-Received: by 2002:adf:a311:0:b0:374:c9f0:752d with SMTP id ffacd0b85a97d-37cd5ae086bmr3345742f8f.47.1727545508853; Sat, 28 Sep 2024 10:45:08 -0700 (PDT) Original-Received: from [10.0.0.1] (193-154-17-87.hdsl.highway.telekom.at. [193.154.17.87]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a56fd1sm104998785e9.48.2024.09.28.10.45.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Sep 2024 10:45:08 -0700 (PDT) Content-Language: de-DE, de-AT, en-GB, en-US Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=francis.pr@gmail.com; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 29 Sep 2024 03:00:55 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148095 Archived-At: 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)