adding color to my printing function
This commit is contained in:
parent
c58ec8f0db
commit
9b73c8a121
2 changed files with 10 additions and 2 deletions
|
|
@ -5094,11 +5094,15 @@ Let's use pdf-tools for a lot better interaction with pdfs.
|
|||
(interactive)
|
||||
(let* ((copies (completing-read "How many copies: " '("1" "2" "3")))
|
||||
(sides (completing-read "Print both sides or one? " '("two sided" "one sided")))
|
||||
(color (y-or-n-p "Print with color?"))
|
||||
(printer (completing-read "Which printer do you want to use?" (chris/list-printers)))
|
||||
(pdf-misc-print-program-args `("-o media=Letter" ,(format "-# %s" copies) ,(format "-P %s" printer) "-o fit-to-page"
|
||||
,(if (string= sides "two sided")
|
||||
"-o sides=two-sided-long-edge"
|
||||
""))))
|
||||
"")
|
||||
,(if color
|
||||
"-o ColorModel=RGB"
|
||||
"-o ColorModel=Gray"))))
|
||||
(message "printing %s copies." copies)
|
||||
(async-shell-command (format "lpr %s '%s'" (string-join pdf-misc-print-program-args " ") (buffer-file-name)))))
|
||||
|
||||
|
|
|
|||
6
init.el
6
init.el
|
|
@ -3741,11 +3741,15 @@ current buffer's, reload dir-locals."
|
|||
(interactive)
|
||||
(let* ((copies (completing-read "How many copies: " '("1" "2" "3")))
|
||||
(sides (completing-read "Print both sides or one? " '("two sided" "one sided")))
|
||||
(color (y-or-n-p "Print with color?"))
|
||||
(printer (completing-read "Which printer do you want to use?" (chris/list-printers)))
|
||||
(pdf-misc-print-program-args `("-o media=Letter" ,(format "-# %s" copies) ,(format "-P %s" printer) "-o fit-to-page"
|
||||
,(if (string= sides "two sided")
|
||||
"-o sides=two-sided-long-edge"
|
||||
""))))
|
||||
"")
|
||||
,(if color
|
||||
"-o ColorModel=RGB"
|
||||
"-o ColorModel=Gray"))))
|
||||
(message "printing %s copies." copies)
|
||||
(async-shell-command (format "lpr %s '%s'" (string-join pdf-misc-print-program-args " ") (buffer-file-name)))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue