Skip to content

Instantly share code, notes, and snippets.

@jsrjenkins
Last active December 19, 2018 16:57
Show Gist options
  • Save jsrjenkins/b0e4cef1ef6a38d8a59cc8a8dabf5764 to your computer and use it in GitHub Desktop.
Save jsrjenkins/b0e4cef1ef6a38d8a59cc8a8dabf5764 to your computer and use it in GitHub Desktop.
(defun my-pdf-misc-print-document (filename copies &optional interactive-p)
(interactive
(list (pdf-view-buffer-file-name) current-prefix-arg t))
(cl-check-type filename (and string file-readable))
(let ((programm (pdf-misc-print-programm interactive-p))
(args (append pdf-misc-print-programm-args
(list (concat "-# "
(if (null copies) "1"
(number-to-string copies))))
(list filename))))
(unless programm
(error "No print program available"))
(apply #'start-process "printing" nil programm args)
(message "Print job started: %s %s"
programm (mapconcat #'identity args " "))))
@jsrjenkins
Copy link
Author

In order to remap the C-c C-p to this new printing function, put in the init.el :

(define-key pdf-misc-minor-mode-map (kbd "C-c C-p") 'my-pdf-misc-print-document)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment