unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Gottfried <gottfried@posteo.de>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: wie kann ich Emacs so einstellen, dass ich drucken kann
Date: Sun, 18 Dec 2022 12:06:16 +0000	[thread overview]
Message-ID: <a3e6356a-6f35-efbe-a92b-43edc0e2d8fd@posteo.de> (raw)
In-Reply-To: <Y52FGkVKhK0TJnLB@protected.localdomain>


[-- Attachment #1.1.1: Type: text/plain, Size: 4826 bytes --]

Hi Jean,

I installed paps with my System GNU Guix
and I copied
........................................
(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))

(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)
 >
 > (defun rcd-paps-text-to-pdf (text &optional file-name title)
 >    (let* ((output (rcd-paps-process text "pdf" title))
 > 	 (file-name (or file-name (concat (file-name-as-directory (getenv 
"HOME")) (read-string "File name without .pdf extension: ") ".pdf"))))
 >      (string-to-file-force output file-name)))
 >
 > (defun rcd-paps-buffer-to-pdf-view ()
 >    (interactive)
 >    (let ((output (rcd-paps-process-buffer))
 > 	(file-name (rcd-temp-file-name nil "pdf")))
 >      (sleep-for 1)
 >      (start-process "evince" nil "evince" (string-to-file-force 
output file-name))))
..........................................
into my init.el file

How does now the program paps find my printer?
because when I wanted to print something it says
"kein voreingestelltes Ziel/No preset destination

What else do I have to do?
Do I have to install pags in emacs?
Do I have to add something in my init.el file to find the printer?

Sorry, but I am learning

thanks for help

Gottfried



Am 17.12.22 um 10:00 schrieb Jean Louis:
> * Gottfried <gottfried@posteo.de> [2022-12-14 19:40]:
>> Hallo,
>> ich wollte einen Puffer ausdrucken (das erste Mal)
>> und es gab diese Fehlermeldung:
> 
> So far best tool to print Emacs buffers that I have found is the
> command `paps' as it supports correctly Unicode, also emoticons. Thus
> you may try by installing `paps' tool from your Operating System
> distribution.
> 
> Das beste Werkzeug zum Drucken von EMACS-Puffern, die ich gefunden
> habe, ist der Befehl "paps", weil es richtig Unicode unterstützt, auch
> Emoticons. Daher können Sie es versuchen, indem Sie das "PAPS"-Tool
> aus Ihrer Betriebssystemverteilung installieren.
> 
> dov/paps: A text to postscript converter through pango:
> https://github.com/dov/paps
> 
> Ich verwende folgende Funktionen:
> 
> (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)
> 
> (defun rcd-paps-text-to-pdf (text &optional file-name title)
>    (let* ((output (rcd-paps-process text "pdf" title))
> 	 (file-name (or file-name (concat (file-name-as-directory (getenv "HOME")) (read-string "File name without .pdf extension: ") ".pdf"))))
>      (string-to-file-force output file-name)))
> 
> (defun rcd-paps-buffer-to-pdf-view ()
>    (interactive)
>    (let ((output (rcd-paps-process-buffer))
> 	(file-name (rcd-temp-file-name nil "pdf")))
>      (sleep-for 1)
>      (start-process "evince" nil "evince" (string-to-file-force output file-name))))
> 
> 😎
> 

-- 
Kind regards

Gottfried

()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  parent reply	other threads:[~2022-12-18 12:06 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 16:38 wie kann ich Emacs so einstellen, dass ich drucken kann Gottfried
2022-12-14 17:27 ` Philip Kaludercic
2022-12-16 15:27   ` printing Gottfried
2022-12-16 22:26     ` printing Michael Heerdegen
2022-12-17  6:29       ` printing tomas
2022-12-17  7:41         ` printing Emanuel Berg
2022-12-17 13:48     ` printing Gottfried
2022-12-17 16:30       ` printing tomas
2022-12-14 21:30 ` wie kann ich Emacs so einstellen, dass ich drucken kann Michael Heerdegen
2022-12-17  9:00 ` Jean Louis
2022-12-17  9:29   ` Michael Heerdegen
2022-12-17  9:41     ` Jean Louis
2022-12-17 10:34       ` Michael Heerdegen
2022-12-17 10:39         ` Michael Heerdegen
2022-12-18  8:04   ` Eduardo Ochs
2022-12-18 17:18     ` Jean Louis
2022-12-18 22:34       ` rcd-paps.el (was: Re: wie kann ich Emacs...) Eduardo Ochs
2022-12-19 12:50         ` rcd-paps.el Jean Louis
2022-12-18 12:06   ` Gottfried [this message]
2022-12-18 17:20     ` wie kann ich Emacs so einstellen, dass ich drucken kann Jean Louis
2022-12-19 13:49       ` Gottfried
2022-12-19 17:19         ` Jean Louis
2022-12-27 16:10           ` wie kann ich Emacs so einstellen, dass ich drucken kann (printing in Emacs) Gottfried
2022-12-27 17:35             ` Jean Louis
2022-12-27 16:39           ` wie kann ich Emacs so einstellen, dass ich drucken kann (printing with paps) Gottfried
2022-12-27 16:47             ` Gottfried
2022-12-27 17:37               ` Jean Louis
2022-12-28 16:31                 ` printing with paps Gottfried
2022-12-30 14:26                   ` Jean Louis
2022-12-31 12:09                     ` Gottfried
2022-12-31 22:53                       ` Jean Louis
2022-12-31 23:46                         ` Jean Louis
2023-01-01 14:24                           ` Gottfried
2023-01-01 14:53                             ` Jean Louis
  -- strict thread matches above, loose matches on Subject: below --
2022-12-17 16:08 wie kann ich Emacs so einstellen, dass ich drucken kann Drew Adams
2022-12-18  2:07 ` Michael Heerdegen
2022-12-18  7:00   ` tomas
2022-12-18  7:24   ` Jean Louis

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=a3e6356a-6f35-efbe-a92b-43edc0e2d8fd@posteo.de \
    --to=gottfried@posteo.de \
    --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).