Ticket #59 (closed enhancement: fixed)

Opened 2 years ago

epdfview should accept input from stdin

Reported by: alexbl@… Owned by: jordi
Priority: trivial Version: 0.1.5
Keywords: Cc:

Description

It would be nice if epdfview could accept input from stdin. For example, a very common workflow for me is something like:

antiword -a letter stupid_idiots.doc | display -

ImageMagick?'s pdf rendering and pdf support in general is kind of scary, so I would much prefer to use epdfview, but if i pipe the output of antiword to epdfview it chokes telling me - is not a file.

Change History

Changed 2 years ago by alexbl@…

It seems changes were made upstream to a number of the poppler tools to support reading from stdin, so it may be a good place to figure out the right way to do this.

Changed 2 years ago by jordi

I checked it out and, as far as I can see, it can't be implemented to accept input from stdin comming from a pipe, because Poppler tries to go at the input stream's end to check if it has “%%EOF” there.

In other words, Poppler's utils accept input like this:

pdftotext - - < file.pdf

But not like this:

cat file.pdf | pdftotext - -

I guess, the only way to accept input from the stdin is to save the file in a temporary file and then load that file.

Changed 2 years ago by jordi

  • status changed from new to closed
  • resolution set to fixed

OK, I tried to implement the idea to save the stdin to a temporary file and load it in commit [258]. It seems to work when redirecting the output of 'cat', 'wget', etc.

Changed 2 years ago by alexbl@…

thanks a ton! This makes my workflow much easier!

Note: See TracTickets for help on using tickets.