Skip to content

Instantly share code, notes, and snippets.

@drmohundro
Created December 16, 2017 17:34
Show Gist options
  • Save drmohundro/560d72ed06baaf16f191ee8be34526ac to your computer and use it in GitHub Desktop.
Save drmohundro/560d72ed06baaf16f191ee8be34526ac to your computer and use it in GitHub Desktop.
GhostScript PDF to text stdout
# requires ghostscript to be installed first - on mac, install with `brew install ghostscript`
# -sDEVICE=txtwrite - text writer
# -sOutputFile=- - use stdout instead of a file
# -q - quiet - prevent writing normal messages to output
# -dNOPAUSE - disable prompt and pause at end of each page
# -dBATCH - indicates batch operation so exits at end of processing
gs -sDEVICE=txtwrite -sOutputFile=- -q -dNOPAUSE -dBATCH to-be-processed.pdf
@drmohundro
Copy link
Author

Via:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment