Opened 5 years ago

Closed 5 years ago

#58449 closed defect (fixed)

pstotext @1.9 Doesn't work anymore

Reported by: tmfuchs Owned by: Kurt Hindenburg <kurt.hindenburg@…>
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: kurthindenburg (Kurt Hindenburg)
Port: pstotext ghostscript

Description

pstotext stops with GPL Ghostscript 9.27: Unrecoverable error, exit code 1 at converting any PDF to TXT, see attached example.

Attachments (1)

test.pdf (7.4 KB) - added by tmfuchs 5 years ago.
A test-PDF.

Download all attachments as: .zip

Change History (13)

Changed 5 years ago by tmfuchs

Attachment: test.pdf added

A test-PDF.

comment:1 Changed 5 years ago by kurthindenburg (Kurt Hindenburg)

Cc: kurthindenburg added

The last version was over 10 years. I can't find any newer releases or website that holds any releases.

comment:2 Changed 5 years ago by kencu (Ken)

Try it using sudo.

comment:3 Changed 5 years ago by tmfuchs

The last version was over 10 years. I can't find any newer releases or website that holds any releases.

Ghostscript 9.27 is invoked and breaks with a GPL Ghostscript 9.27: Unrecoverable error, exit code 1. So it seems to be a problem with Ghostscript.

Try it using sudo.

I did that the first time and tried it again now (after sudo port -fp uninstall installed). It doesn't work.

comment:4 Changed 5 years ago by Kurt Hindenburg <kurt.hindenburg@…>

In 50ec531f081a4c80e1e3e48e24f33cd330ed4e7f/macports-ports (master):

pstotext: update homepage, master site; add patch for CVE

The current sites are down so use archive website. Use Debian file and
patch for CVE. Use correct compiler.

This doesn't fix the gs exit code 1. It does work somewhat on some
pdf files.

See #58449

comment:5 Changed 5 years ago by kurthindenburg (Kurt Hindenburg)

If you add -debug for your test.pdf, you get

QI 100 0 0 -100 0 79200
Error: /syntaxerror in /----nostringval----
GPL Ghostscript Operand stack:
9.26:
Unrecoverable error, exit code 1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   2044   1   3   %oparray_pop   2043   1   3   %oparray_pop   2024   1   3   %oparray_pop   1884   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push
Dictionary stack:
   --dict:956/1684(ro)(G)--   --dict:0/20(G)--   --dict:80/200(L)--
Current allocation mode is local

For other pdfs I get:

Error: /undefined in --showpage--

comment:6 Changed 5 years ago by kencu (Ken)

I recall now -- I'm sorry. I use ps2ascii to do this function, which is in the ghostscript package. Not sure if it's 100% identical to what pstotext does, but works for what I need it to do. It seems to read pdf files too. It had no trouble with your test pdf.

I had trouble with it once in a script, fixed by running it as sudo.

$ port -v installed ghostscript
The following ports are currently installed:
  ghostscript @9.26_0+x11 (active) platform='darwin 8' archs='ppc' date='2018-12-10T00:04:15-0800'
$ port contents ghostscript | grep ps2ascii
  /opt/local/bin/ps2ascii
  /opt/local/share/man/de/man1/ps2ascii.1
  /opt/local/share/man/man1/ps2ascii.1.gz
$ /opt/local/bin/ps2ascii test.pdf
     This is a test.

comment:7 Changed 5 years ago by kurthindenburg (Kurt Hindenburg)

OK, ps2ascii doesn't work here - I'd be happy to obsolete pstotext if there's a replacement.

ghostscript @9.26_0+x11 (active) platform='darwin 17' archs='x86_64' date='2019-04-30T08:23:14-0400'

ps2ascii test.pdf

Error: /syntaxerror in /----nostringval----

comment:8 Changed 5 years ago by kencu (Ken)

So -- ps2ascii does work for me, as you can see, on the systems I have. Configuration thing?

  ghostscript @9.26_0+universal+x11 (active) platform='darwin 10' archs='i386 x86_64' date='2018-11-26T23:13:09-0800'

$ ps2ascii test.pdf
     This is a test.

let me try Mojave.

Last edited 5 years ago by kencu (Ken) (previous) (diff)

comment:9 Changed 5 years ago by kencu (Ken)

$ port -v installed ghostscript
The following ports are currently installed:
  ghostscript @9.26_0+x11 (active) platform='darwin 18' archs='x86_64' date='2018-11-25T08:32:13-0800'
$ ps2ascii test.pdf
     This is a test.

comment:10 Changed 5 years ago by kurthindenburg (Kurt Hindenburg)

Ah sorry my fault - my test.pdf was bad; ps2ascii works here.

pdftotext prints out the text but still has the error

comment:11 Changed 5 years ago by kencu (Ken)

I'll leave you to decide if pstotext should be obsoleted.

comment:12 Changed 5 years ago by Kurt Hindenburg <kurt.hindenburg@…>

Owner: set to Kurt Hindenburg <kurt.hindenburg@…>
Resolution: fixed
Status: newclosed

In e391289debf2db18ab2b5d222cb3d279bf85e2d2/macports-ports (master):

pstotext: remove port; use ps2ascii instead

Last release was over 10 years and no offical site still exist. It
does not appear to work for any pdf without an error:
Unrecoverable error, exit code 1

Use ps2ascii from the ghostscript port

closes #58449

Note: See TracTickets for help on using tickets.