Bug 7334 - pdftotext stdin support
Summary: pdftotext stdin support
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) All
: medium enhancement
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2006-06-26 09:38 UTC by Dom Lachowicz
Modified: 2010-05-27 11:58 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
patch to implement the requested feature (754 bytes, patch)
2006-06-26 09:40 UTC, Dom Lachowicz
Details | Splinter Review

Description Dom Lachowicz 2006-06-26 09:38:38 UTC
It would be useful if pdftotext had a mode to accept text from stdin, as it
already can pipe its results to stdout. This is useful in gateways and frontends
that don't want to (or can't) use an temporary on-disk file. 

I'll attach a very small patch that does this.
Comment 1 Dom Lachowicz 2006-06-26 09:40:09 UTC
Created attachment 6051 [details] [review]
patch to implement the requested feature

Example usage:

pdftotext - - < foo.pdf > foo.txt
Comment 2 Albert Astals Cid 2006-08-04 15:48:18 UTC
fixed in cvs
Comment 3 jwbaker 2008-05-05 11:34:26 UTC
This seems to have regressed.  In poppler 0.8.2, the invocation pdftotext - - complains that "Error: Document base stream is not seekable".
Comment 4 jwbaker 2008-05-05 11:43:46 UTC
Not sure why this is marked as cairo backend.  Probably belongs in general.
Comment 5 Albert Astals Cid 2008-05-05 14:37:17 UTC
That's right, the base stream needs to be seekable or otherwise poppler does not work at all. 

On the other hand i just tried to do 
./utils/pdftotext - < ~/okularfiles/pdf/alumnes_normativa.pdf 
and it created a -.txt file containing the text contents of alumnes_normativa.pdf

I'm not sure what could cause that behaviour change. 

Which shell are you using?
I tried with GNU bash, version 3.2.33(1)-release (x86_64-pc-linux-gnu) and 
zsh 4.3.4 (x86_64-unknown-linux-gnu) and both worked

Comment 6 Albert Astals Cid 2010-05-27 11:58:31 UTC
Should be working in the latests 0.13.x releases


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.