Open julian-hoch opened 1 month ago
I have never tried this so I am going by reading the code so beware!
print-buffer
has not chance of working with pdf-tools
since it prints the buffer text which pdf-tools
hides using overlays and instead shows the rendered images for pages.
pdf-misc-print-document
which is bound to C-c C-p
uses pdf-misc-print-program-executable
and pdf-misc-print-program-args
to do the printing. However they are unset by default which is why you get prompted for the path (i.e. you are supposed to enter the path to executable that does the printing).
Since print-buffer
and dired-do-print
are working, I think you should be able use the values of lpr-command
and lpr-swithces
for pdf-misc-print-program-executable
and pdf-misc-print-program-args
respectively. (If this works it would be nice if you could do a PR so that these values are used without user doing anything.)
Thanks! That was really helpful. Setting pdf-misc-print-program-executable
to "lpr" worked, I guess setting that in my init.el will do the trick. Potentially it would be a good idea to fall back to "lpr" if nothing else is defined, but I am not sure if there are reasons we do not know why this was not done in the first place (I mean there must be a reason why this variable exists and is nil by default, right?).
In any case, my elisp chops are not up to standard yet to take that up myself, but hopefully if anyone else has the same issue this ticket will help guide them.
Perhaps I am missing something, but I cannot figure out how to print from pdf-tools. I can print fine from dired using
dired-do-print
, but when I open the pdf in pdf-tools and try e.g.print-buffer
, it only outputs the source code, not the rendered pdf. The readme mentions C-c C-p, but for me this opens a query in the mini buffer ("Print with") where I am supposed to enter a path (not sure what to?), instead of printing the current file.