PDF to Text using Ghostscript

gs -sDEVICE=txtwrite -o output.txt input.pdf