Why pstopdf Stopped Working, and What Actually Replaces It
Your script is fine. Apple deleted the pstopdf command itself in macOS Sonoma. We installed its usual replacement, timed it, and found a default setting that can quietly resize your output before you even notice.
By Ram Velmurugan · Founder & Lead Developer, 1dot.ai
pstopdf along with the rest of macOS's built-in PostScript-to-PDF conversion in macOS 14 Sonoma. Install Ghostscript (brew install ghostscript) and use its ps2pdf command instead. It is not an exact match: it has no -l or -p flag, and in our test it defaulted to the wrong page size for a Letter-sized document until we told it which paper size to use. Once you name the paper size (or add -dEPSCrop for EPS files), it produced a correctly sized PDF in well under a tenth of a second per file.Editorial note: 1dot.ai makes Quick X Folder Preview, a folder and archive preview app for Mac mentioned near the end of this guide. It does not convert PostScript or EPS files and plays no role in the testing below. Every command in this guide was actually run, on Ghostscript 10.02.1, in a Linux container, not on a Mac. Ghostscript's commands and flags behave the same on every platform; where a result depends on something outside Ghostscript itself, a system paper-size default, we say so and show our work rather than assume it carries over to your Mac unchanged. Sources checked live on November 21, 2026.
The Short Version
If a shell script, a Makefile, or a scheduled job on your Mac suddenly fails with pstopdf: command not found, the tool did not move or get renamed. Apple deleted it. It shipped as a built-in command-line utility from early Mac OS X through macOS 13 Ventura, and Apple's own AppKit release notes for macOS 14 confirm the removal in writing, if indirectly: "NSEPSImageRep was deprecated in macOS 14.0 as encapsulated PostScript (EPS) files are no longer supported by macOS." Coverage of the same release at the time reported the fuller picture: the whole PostScript-to-PDF conversion stack went with it, pstopdf included.
This is the automation-side companion to our EPS Quick Look preview guide. That one covers Finder thumbnails and Preview, a viewing problem. This one covers scripts, Makefiles, and anything else that called pstopdf programmatically, an automation problem with a different fix and a gotcha of its own.
- What pstopdf Did, and When It Left
- The Replacement: Ghostscript's ps2pdf
- What We Measured: Speed and File Size
- The Gotcha: a Page Size You Didn't Ask For
- Converting EPS Files Specifically
- Your Options
- A Drop-In Wrapper for Old Scripts
- Comparing Your Options
- Does Quick X Folder Preview Fix This?
- Sources & Further Reading
- FAQ
What pstopdf Did, and When It Left
Apple's own man page for the tool, mirrored on unix.com, describes the syntax plainly: pstopdf [inputfile] [-o outname] [-l] [-p] [-i]. Give it a PostScript file and it writes a matching .pdf in the current directory, unless -o names a different output path. -i reads PostScript from standard input instead of a file. -l writes conversion messages to a log file. -p prints a progress message to stdout after each page. It was a thin wrapper around Apple's own PSNormalizer engine and Core Graphics' CGPSConverter, the same machinery that let Preview open PostScript and EPS files directly.
The removal happened in stages, which is why old troubleshooting advice stopped working piece by piece. macOS 12.3 Monterey dropped inline PostScript viewing in WebKit (Safari) first. Ventura (macOS 13, October 2022) removed PostScript and EPS support from Preview itself. Then Sonoma (macOS 14, September 2023) removed the system-level conversion entirely. The Eclectic Light Company's contemporary reporting on Apple's own Sonoma release notes lists four concrete effects: CGPSConverter now returns an error when called, ImageIO no longer converts EPS files, NSEPSImageRep no longer displays them, and PMPrinterPrintWithFile rejects PostScript sent to a non-PostScript print queue. The pstopdf command-line tool went with the rest of that stack, since it had nothing left to call.
Developers noticed within days. An Apple Developer Forums post from September 2023 noted that both pstopdf and the PSNormalizer framework were gone from Sonoma. A MacRumors thread started on September 17, 2023 collected the fallout: man pages piped to Preview, Terminal printing, and other workflows people had used for decades. On November 26, 2023, a MacTeX user on Sonoma 14.1.1 reported that TeXShop's simpdftex script failed with /usr/bin/pstopdf: No such file or directory. Copying a pstopdf into /usr/local/bin did not help, because the script called the full /usr/bin path. That detail matters for the wrapper below.
The Replacement: Ghostscript's ps2pdf
Ghostscript is a free, open-source PostScript and PDF interpreter maintained by Artifex. It installs with Homebrew: brew install ghostscript. That gives you two relevant commands: gs, the interpreter itself, and ps2pdf, a small shell script bundled with it that wraps gs specifically for PostScript-to-PDF conversion, the same job pstopdf used to do.
For a plain file, the command is about as short as the one it replaces: ps2pdf input.ps output.pdf. If you only need the conversion and nothing about pstopdf's exact flags, that single line covers most scripts.
What We Measured: Speed and File Size
We wrote a one-page PostScript file (text and a filled rectangle, 612×792pt bounding box, the dimensions of US Letter) and a three-page version, then ran both through ps2pdf and through gs directly, timing each with the shell's built-in time:
| File | Command | Time | Output size |
|---|---|---|---|
| Single page | ps2pdf | 0.066s | 2,519 bytes |
| Single page | gs -sDEVICE=pdfwrite | 0.080s | 2,425 bytes |
| Three pages | ps2pdf | 0.087s | 3,321 bytes |
Both tools confirmed a correct three-page PDF for the multi-page file (checked with pdfinfo). For a script converting a handful of files on demand, either command finishes before you'd notice a delay. Neither is the bottleneck in a build pipeline that also compiles LaTeX or runs other tools around it.
The Gotcha: a Page Size You Didn't Ask For
ps2pdf with no paper size specified, the output PDF came out 595×842pt, A4, not Letter. Ghostscript does not read the %%BoundingBox comment of a plain .ps file. It uses the page size the file sets in code, and when the file sets none, it falls back to a default. On our Linux test system that default came from /etc/papersize, set to A4 by the libpaper package Ghostscript is built against there.A Mac fails in the opposite direction. Homebrew's Ghostscript formula has no libpaper dependency, and Ghostscript's documentation says it ships with US Letter as its default page size. We reproduced that setup by pointing our test system's paper default at Letter, then converted an A4 file that sets no page size. It came out 612×792pt, Letter, with the bottom of the page cut off. So the Mac risk falls on anyone converting A4 documents, which covers most of the world outside North America.
Two more runs showed how far the fix should go. Adding -sPAPERSIZE=letter alone fixed the undeclared Letter file. A file that sets its own page size in code (PostScript from printer drivers usually does) came out at its own size whatever the default was, with or without that flag. Adding -dFIXEDMEDIA, which many guides pair with the paper size, changed that. It forced an A4 file that declared its own size onto a Letter page. Name the paper size and leave -dFIXEDMEDIA out unless every file you convert really is that size. We can't run the real pstopdf anymore to see which default it used, so this is a statement about Ghostscript, not a before-and-after comparison.
| Input file | Command | Output page |
|---|---|---|
| Letter, size not set in code | ps2pdf (A4 default) | 595×842 (A4), wrong |
| A4, size not set in code | ps2pdf (Letter default, as on a Mac) | 612×792 (Letter), wrong |
| Letter, size not set in code | ps2pdf -sPAPERSIZE=letter | 612×792, correct |
| Letter, size set in code | ps2pdf (A4 default) | 612×792, correct |
| A4, size set in code | ps2pdf -sPAPERSIZE=letter | 595×842, correct |
| A4, size set in code | ps2pdf -sPAPERSIZE=letter -dFIXEDMEDIA | 612×792, wrong |
All six runs used Ghostscript 10.02.1 on November 21, 2026, page sizes read with pdfinfo.
Converting EPS Files Specifically
EPS files carry their own bounding box rather than a full page size, so the fix is a different flag: -dEPSCrop. We ran a 200×150pt test figure both ways at the PDF stage. Without the flag, Ghostscript placed the artwork on a full default-size page (595×842pt in our test), with the figure small in one corner. With -dEPSCrop added, the output page measured exactly 200×150pt, matching the figure. Unlike a raster PNG conversion, where cropping a small logo out of a full page can cut the file size by nearly 90 percent (we measured that case in our EPS preview guide), the PDF file size barely moved here, 2,357 bytes against 2,367. For vector output the problem cropping solves is the page dimensions, not file bloat.
Your Options
Install Ghostscript and run ps2pdf
Ghostscript is a free, open-source PostScript and PDF interpreter maintained by Artifex, the same engine behind the fix we tested for EPS Quick Look previews. Install it with `brew install ghostscript`. It installs a `ps2pdf` command alongside the main `gs` binary.
For a plain `.ps` file: `ps2pdf input.ps output.pdf`. That is the direct equivalent of the old `pstopdf input.ps` for the common case, one file in, one PDF out.
Name the paper size instead of trusting the default. We measured a real case below where the default did not match the source document. Add `-sPAPERSIZE=letter` (or `a4`, whatever your documents use). Leave out `-dFIXEDMEDIA`, which several guides pair with it: in our test it forced an A4 document that declared its own size onto a Letter page.
Free, needs Homebrew and one Terminal commandConvert EPS files with -dEPSCrop
If your script converts `.eps` files specifically, skip the paper-size flags and add `-dEPSCrop` instead: `gs -dNOPAUSE -dBATCH -dEPSCrop -sDEVICE=pdfwrite -sOutputFile=output.pdf input.eps`. This sizes the output page to the EPS file's own bounding box, which is normally what you want for a logo, a chart, or any other small piece of artwork rather than a full page.
We ran this both ways on a 200×150pt test file. Without the flag, the artwork landed on a full default-size page. With it, the output page measured exactly 200×150pt, matching the source.
Free, one extra flagReplace pstopdf with a small script that accepts its old flags
If a script calls `pstopdf` with its original flags (a bare file, `-o name`, or `-i` from stdin) and rewriting every call line is more work than you want, a small replacement script closes most of the gap. Make it a real file, not a function in `.zshrc`: a function defined in your shell profile is invisible to a Makefile or a `#!/bin/bash` script, which is exactly where `pstopdf` calls live. Save this as `/usr/local/bin/pstopdf` (or `~/bin/pstopdf` if that folder is on your PATH) and run `chmod +x` on it:
#!/bin/bash
# pstopdf replacement: maps the old flags onto Ghostscript's ps2pdf
outname="" fromstdin=0 infile=""
while [ $# -gt 0 ]; do
case "$1" in
-o) outname="$2"; shift 2 ;;
-i) fromstdin=1; shift ;;
-l|-p) shift ;; # no ps2pdf equivalent; accepted and ignored
*) infile="$1"; shift ;;
esac
done
if [ "$fromstdin" = "1" ]; then
exec ps2pdf - "${outname:-stdin.pdf}"
fi
base="${infile##*/}"
exec ps2pdf "$infile" "${outname:-${base%.*}.pdf}"We called it from both bash and sh three ways: a file in another folder, -o with -l -p added, and -i from stdin. All three matched a direct ps2pdf run in page count, page size and file size. Like the original, it writes to the current directory when you don't pass -o, and names stdin output stdin.pdf, as pstopdf's man page specifies. It does not restore a log file or per-page progress output, since Ghostscript has no direct equivalent for either. Add -sPAPERSIZE=a4 or letter to the two ps2pdf lines if your files don't set their own page size.
One limit, from the MacTeX report above: if the broken script calls the full path /usr/bin/pstopdf, no replacement on your PATH will catch it. The error then reads No such file or directory rather than command not found. System Integrity Protection blocks adding files to /usr/bin, so edit that one line of the script to call pstopdf by name instead.
Run an older macOS in a VM, or use a paid converter you already own
If you need pstopdf's exact original behavior rather than a close equivalent, for example a one-off batch job where rewriting the script is not worth it, running a pre-Sonoma macOS version in a lightweight VM on Apple silicon gives you the real tool again, inside that VM. Adobe Acrobat's Distiller does PostScript-to-PDF conversion too, if you already have a paid Acrobat license. Both are heavier than installing Ghostscript, and neither is something to set up just for this.
Works, but neither is a casual optionComparing Your Options
| Method | Matches old behavior | Cost | Requires |
|---|---|---|---|
| ps2pdf / gs (Ghostscript) | Close, once paper size is set explicitly | Free | Homebrew, one install |
| Wrapper script | Matches pstopdf's file, -o, and -i flags exactly in our test | Free | Ghostscript, one script on your PATH |
| Adobe Distiller | High, if you already use Acrobat for this | Requires a paid Acrobat license | Adobe Acrobat Pro |
| Older macOS in a VM | Exact, the real tool | Free to set up, heavy to maintain | Virtualization software, a macOS installer image |
Does Quick X Folder Preview Fix This?
No. Quick X Folder Preview adds Quick Look previews for folders, archives, source code, Markdown, Jupyter notebooks, LaTeX, data files, subtitles, torrents, web archives, ebooks, and comics, 13 extensions in total. None of them touch PostScript or EPS conversion, and the app doesn't run from a script in the way this problem calls for.
pstopdf, Ghostscript above is the real fix. If your problem is instead that EPS files won't show a thumbnail in Finder, that's a related but separate issue, covered in our dedicated guide linked below.Sources & Further Reading
Apple's own record of the removal: Apple Developer, "AppKit Release Notes for macOS Sonoma 14" (NSEPSImageRep deprecation) and Apple Support, "View .ps and .eps files on Mac".
The fuller breakdown of what Sonoma removed, including CGPSConverter and pstopdf by name: The Eclectic Light Company, "PostScript's sudden death in Sonoma".
Developer impact reports: Apple Developer Forums, thread 737545, MacRumors Forums, "PostScript is dead" (Sep 17, 2023), and a MacTeX mailing list report of a broken build script.
pstopdf's original syntax: unix.com, pstopdf(1) man page mirror.
Ghostscript's own project and documentation: ghostscript.com, and its usage guide (default Letter page size, -sPAPERSIZE, -dFIXEDMEDIA). Homebrew's build: ghostscript formula.
Our related coverage: Why EPS Files Won't Preview on Mac Anymore, and What to Use Instead, which covers Finder thumbnails and Preview rather than scripts, and our complete Quick Look troubleshooting guide for preview problems unrelated to PostScript.
Frequently Asked Questions
The Bottom Line
Your script isn't broken. Apple deleted pstopdf in macOS Sonoma, along with the rest of the system's built-in PostScript-to-PDF conversion. Install Ghostscript and swap in ps2pdf, but don't copy the command verbatim from the first result you find. Name the paper size or add -dEPSCrop for EPS input, we measured a real case where skipping that step silently produced the wrong page size, and the wrapper script above covers pstopdf's old flags for scripts you'd rather not rewrite line by line.
Looking for more Mac troubleshooting guides? Read our EPS preview fix guide if your problem is Finder thumbnails rather than a script, see our complete Quick Look fix guide for preview problems unrelated to PostScript, browse every 1dot.ai guide, or check Quick X Folder Preview's product page for the full list of formats it covers.
Want Folder and Archive Previews Without Extracting?
Quick X Folder Preview adds 13 Quick Look extensions to the space bar, notarized by Apple. Free for 14 days, then $4.99 once for a lifetime license.
Try It FreeRead More Guides