pstotext - Extract text from PostScript and PDF files

Distribution: Ubuntu 16.04 LTS (Xenial Xerus)
Repository: Ubuntu Universe amd64
Package name: pstotext
Package version: 1.9
Package release: 6
Package architecture: amd64
Package type: deb
Installed size: 123 B
Download size: 32.87 KB
Official Mirror:
pstotext extracts text (in the ISO 8859-1 character set) from a PostScript or PDF (Portable Document Format) file. Thus, pstotext is similar to the ps2ascii program that comes with ghostscript. The output of pstotext is however better than that of ps2ascii, because pstotext deals better with punctuation and ligatures.



    Binary package: pstotext_1.9-6_amd64.deb
    Source package: pstotext

    Install Howto

    1. Update the package index:
      # sudo apt-get update
    2. Install pstotext deb package:
      # sudo apt-get install pstotext


    • /usr/bin/pstotext
    • /usr/lib/mime/packages/pstotext
    • /usr/share/doc/pstotext/README.Debian
    • /usr/share/doc/pstotext/changelog.Debian.gz
    • /usr/share/doc/pstotext/copyright
    • /usr/share/man/man1/pstotext.1.gz


    2012-03-05 - Jan Jeroným Zvánovec <> pstotext (1.9-6) unstable; urgency=low * [debian/rules] use dpkg-buildflags; fix "Please enabled hardened build flags", applied patch courtesy of Moritz Muehlenhoff (Closes: #655105) * [debian/rules] providing build-arch and build-indep as recommended by lintian * [debian/control] updated to Standars-Version: 3.9.3 (no changes needed) * removing templates [debian/postinst.debhelper] and [debian/postrm.debhelper]

    2010-07-10 - Jan Jeroným Zvánovec <> pstotext (1.9-5) unstable; urgency=medium * New maintainer (closes: #585061) * [debian/control] updated dependency on ghostscript (closes: #539671) * [debian/rules] -fno-string-aliasing workaround to prevent broken compilation of type punning (closes: #586914) * [debian/copyright] new maintainer, including pstotext.txt only once (closes: #289097) * [debian/control] updated to Standards-Version: (no changes needed) * [debian/control] new Homepage field added; added ${misc:Depends} * [debian/{preinst,postinst,prerm,postrm}] deleted because trivial * [debian/README.debian] doc path fixed; new maintainer * [debian/compat] set to 7 * [debian/source/format] set to "3.0 (quilt)" * [debian/watch] added * patches moved from diff.gz to debian/patches * [debian/rules] - builds in debian/pstotext instead of debian/tmp; dh_installman instead of dh_install_manpages; wiped useless dh_*

    2006-05-21 - J.H.M. Dassen (Ray) <> pstotext (1.9-4) unstable; urgency=medium * [main.c] Applied patch courtesy of Martin Ehmsen <> to unbreak pstotext on input from stdin which was broken by 1.9-3's security patch. (Closes: #356988)

    2006-05-05 - J.H.M. Dassen (Ray) <> pstotext (1.9-3) unstable; urgency=high * [main.c] Security fix. popen(3) was being used in a construct which could did not perform sufficient cleanup/quoting of filenames; these filenames could come from untrusted sources like a web indexing service and could thus be misused to execute shell code as the user running pstotext. The use of popen(3) has been replaced by an explicit fork/pipe construct which does not involve the use of a shell. (Closes: #356988) * [debian/control] Change the non-virtual package suggestion for the dependency on the "gs" virtual package to gs-gpl as gs-aladdin has become a transitional package. * [debian/control] Updated Standards-Version.

    2005-07-27 - J.H.M. Dassen (Ray) <> pstotext (1.9-2) unstable; urgency=high * [main.c] Security fix: call Ghostscript with -dSAFER to prevent malicious PostScript data from altering the filesystem or opening pipes to arbitrary external programs. This problem was remotely exploitable (through pstotext's registration with /etc/mailcap as a viewer application). The problem was identified and patched by Max Vozeler <>.

    2004-01-13 - J.H.M. Dassen (Ray) <> pstotext (1.9-1) unstable; urgency=low * New upstream, incorporating Debian's code changes. * [debian/copyright, debian/README.Debian] Updated. * [debian/control] Updated Standards-Version.

    2003-08-28 - J.H.M. Dassen (Ray) <> pstotext (1.8g-6) unstable; urgency=low * Implemented current policy and updated Standards-Version accordingly. * Corrected priority. * [debian/mime] Added `copiousoutput' to the PDF entry. (Closes: #207374) * [debian/mime] Added workarounds for lynx not dealing with the `copiousoutput' flag properly. (Closes: #170848)

    2002-02-02 - J.H.M. Dassen (Ray) <> pstotext (1.8g-5) unstable; urgency=medium * MAXPATHLEN patch caused core dump on empty argument list; reworked it. * Minor code cleanup: dealt with a few compiler warnings. * Use mkstemp() in tempfile generation.