Someone wants to convert PDF to TXT as explained in C# GhostScript - Not able to successfully convert from PDF to TXT file.

I am not sure whether GhostScript can do that. Is it possible?

closed as off topic by lockstep, Leo Liu, Lev Bishop, Andrey Vihrov, xport Jul 15 '11 at 19:46

Questions on TeX - LaTeX Stack Exchange are expected to relate to TeX, LaTeX or related typesetting systems within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

       pdftotext - Portable Document Format (PDF) to text converter (version 3.00)

       pdftotext [options] [PDF-file [text-file]]

       Pdftotext converts Portable Document Format (PDF) files to plain text.

       Pdftotext  reads  the  PDF file, PDF-file, and writes a text file, text-file.  If text-file is not specified, pdftotext con-
       verts file.pdf to file.txt.  If text-file is ´-', the text is sent to stdout.
  • 1
    Check out the -layout option. You might want to disable page numbers etc. (i.e. \pagestyle{empty}). – Martin Scharrer Jul 15 '11 at 16:50

Yes. It is absolutely possible. Using the following batch file.

rem batch.bat
rem %1 represents input file name without extension.
echo off
gswin32c -q -dNODISPLAY -dSAFER -dDELAYBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps %1.pdf -c quit >%1.txt

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