Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

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.

add comment

2 Answers 2

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

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

DESCRIPTION
       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.
share|improve this answer
    
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
add comment
up vote 2 down vote accepted

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
share|improve this answer
add comment

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