[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Print with mupdf?

On Wed, Sep 19, 2018 at 10:01:04PM -0500, Greg Marks wrote:
> With the PDF file open in mupdf, you can enter this Bash command in a
> terminal to print the PDF:
>    pdfviewercommand="\/usr\/lib\/mupdf\/mupdf-x11 -r [1-9][0-9]\+" ; pdfpid=$(ps -lu $(whoami) | grep mupdf | sed 's/^[^ ]\+ \+[^ ]\+ \+[^ ]\+ \+\([0-9]\+\) .*/\1/g') ; pdffile=$(cat /proc/$pdfpid/cmdline | tr '\0' '\40' | sed "s/^$pdfviewercommand \+\(.*\)/\1/g" | sed 's/ \+$//g') ; directory=$(pwdx $pdfpid | cut -d' ' -f 2) ; lpr $directory/$pdffile


> Of course, you'd want to create an alias or a function for this.
> With a little bit more work, you could have it offer you options in
> the event that more than one PDF is open.

I might be best served trying a few of the other suggested PDF viewers;
there are probably others that can compete with the opening speed of
mupdf that also offer printing.

Thanks everyone for the suggestions.

Reply to: