PS2ASCII(1)

πŸ“¦
version 10.08.0 Β· 5 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

ps2ascii(1) β€” bestie, it's giving text extraction ✨

okay so picture this: you've got a PostScript file or a PDF and you just want the words out of it, no fonts, no shapes, no drama. that's what ps2ascii is for, and she's a Ghostscript translator from PostScript or PDF to text. no cap. πŸ’–


🌸 SYNOPSIS 🌸

ps2ascii [ input.ps [ output.txt ] ]
ps2ascii input.pdf [ output.txt ]

like… two moods. .ps gets the optional brackets, .pdf is just straight up there. iconic behavior honestly. πŸŽ€


✨ DESCRIPTION ✨

So ps2ascii uses gs(1) to yank the text out of PostScript(tm) or Adobe Portable Document Format (PDF) files. that's the whole job. that's her moment. πŸ’…

Here's the vibe on the args, listen up:

  • if you don't name any files on the command line, then gs reads from standard input. so you can just pipe stuff in, go off king 🫢
  • if you don't name an output file, the ASCII text goes to standard output. she's a talker, she'll just tell you. πŸ¦‹
🚨 lore drop: the old ps2ascii.ps program was deprecated and got removed some years ago. rest in peace queen, she's gone.

so now the scripts use the txtwrite device to extract text from the input instead. and honestly? it does a generally better job than the old PostScript program did, and it can extract Unicode, not just ASCII. slay. ✨

but β€” and this is the part where we hold hands 🫢 β€” it no longer supports the COMPLEX feature. that feature is not invited to the party anymore. periodt.


πŸ‘€ SEE ALSO πŸ‘€

more documentation on the txtwrite device lives right here, go read it, i know you want to:

https://ghostscript.readthedocs.io/en/latest/Devices.html#text-output

⭐ VERSION ⭐

this document was last revised for Ghostscript version 10.04.0. keeping it fresh. 🧚


πŸ‘‘ AUTHOR πŸ‘‘

Artifex Software, Inc. are the primary maintainers of Ghostscript. main character energy, truly. πŸ’œ

and David M. Jones <dmjones@theory.lcs.mit.edu> made substantial improvements to ps2ascii. king behavior, we appreciate you. πŸ™ˆ


k that's the whole page bestie, ily, go extract some text πŸ’– this was 10.04.0, dated 18 Sept 2024, and it's out. πŸŽ€βœ¨

πŸ“¦ where this page comes from