I am looking for a GUI program that opens a pdf from stdin.

For instance, if pdf_stdin is the command that opens my pdf from stdin, I'd like to use

  • ggp -d -r mail@mail.com encrypted.pdf.gpg -o - | pdf_stdin
  • man -t arpwatch | pdf_stdin
  • 1
    In general, it's unlikely, since PDFs are supposed to be read from the end, stackoverflow.com/a/11896942/2072269, and stdin from a pipe is not seekable, so once it reaches the end, unless it had the whole thing cached, it won't be able to display the rest of the PDF.
    – muru
    Mar 23 '17 at 10:17

Zathura (archwiki) is a minimalist document viewer (PDF/PS/Djvu/CB). It can display documents from stdin.

cat foo.pdf | zathura - 

The version on my system saves the pipe temporarily to /tmp, so the displayed document is seekable. The temporary file is cleaned up afterward and has reasonably secure permissions, but these could be security concerns.

$ ls -l /tmp/z*
-rw------- 1 user user 1640882 Mar 23 06:26 /tmp/zathura.stdin.97PFXY

It's available in the standard repositories on Arch, Debian and Ubuntu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.