3

i'm trying to extract the text from a PDF. I'm working with Ghostscript but when i run the command below

gs -dBATCH -dNOPAUSE -sDEVICE=txtwrite mypdf.pdf

an error occurs. This one below.

Unknown device: txtwrite
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
             defaultdevice

Any idea about it? Isn't txtwrite a default ghostscript device ?

This is the output of gs -v

GPL Ghostscript 8.70 (2009-07-31)

and that one the OS Version CentOS release 5.8 (Final).

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
alesdario
  • 1,873
  • 6
  • 25
  • 38
  • 1
    Try to examine this topic [PDF TEXT Extraction](http://stackoverflow.com/questions/6187250/pdf-text-extraction). I think your GS version doesn't support txtwrite device. – valex Aug 30 '12 at 14:12

1 Answers1

8

The txtwrite device was introduced to Ghostscript in 9.05 if I remember correctly (current version is 9.06). 8.70 is really quite old and much too old to include this device.

Upgrade to a more recent version.

KenS
  • 30,202
  • 3
  • 34
  • 51