PostScript Preview for VS Code
A popular PostScript and EPS file previewer for Visual Studio Code — Preview, pan, zoom, and debug your .ps and .eps files directly in VS Code. Supports multi-page documents, GhostScript console output, custom themes, and more.
✨ Features
- Live Preview — View EPS and PS files side-by-side with your code
- Pan & Zoom — Smooth SVG-based pan and zoom controls
- Multi-Page Support — Navigate through multi-page PostScript documents
- Theme Support — Automatic light/dark mode matching VS Code theme
- Background Color Picker — Customize preview background color
- Console Output — View GhostScript output (from
==, print, etc.)
- Custom Paths — Configure paths to GhostScript and Poppler tools
- Auto-Refresh — Preview updates automatically when you save
🚀 Quick Start
- Install this extension from the VS Code Marketplace
- Install GhostScript and Poppler
- Open any
.ps or .eps file
- Click the preview icon in the editor title bar
📋 Requirements
This extension requires:
- PostScript Language extension for syntax highlighting
- GhostScript (provides
ps2pdf)
- Poppler (provides
pdftocairo and pdfinfo)
macOS
brew install ghostscript poppler
Ubuntu / Debian
sudo apt-get install ghostscript poppler-utils -y
Windows
Install via Chocolatey (run as Administrator):
choco install ghostscript --version 9.55.0 --force -y
choco install poppler --version 0.89.0 -y --force
Add to PATH:
[Environment]::SetEnvironmentVariable("Path",[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) + ";C:\Program Files\gs\gs9.55.0\lib;C:\Program Files\gs\gs9.55.0\bin;C:\ProgramData\chocolatey\lib\poppler\tools",[EnvironmentVariableTarget]::Machine)
Restart VS Code after installation.
Manual PATH setup
If you have issues setting PATH, add these manually via System Properties → Environment Variables:
C:\Program Files\gs\gs9.55.0\lib
C:\Program Files\gs\gs9.55.0\bin
C:\ProgramData\chocolatey\lib\poppler\tools
Configuration
Configure custom executable paths in VS Code settings (useful for conda environments or non-standard installations):
| Setting |
Description |
Default |
postscript-preview.path.ps2pdf |
Path to ps2pdf executable |
ps2pdf |
postscript-preview.path.pdftocairo |
Path to pdftocairo executable |
pdftocairo |
postscript-preview.path.pdfinfo |
Path to pdfinfo executable |
pdfinfo |
Example settings.json:
{
"postscript-preview.path.ps2pdf": "/opt/ghostscript/bin/ps2pdf",
"postscript-preview.path.pdftocairo": "/opt/poppler/bin/pdftocairo"
}
Multi-Page Documents
For PostScript files with multiple showpage commands, navigation controls appear automatically:
- ◀ / ▶ — Navigate between pages
- Page input — Jump to a specific page
The preview resets to page 1 when the source file is modified.
Console Output
View GhostScript output in VS Code:
- Open Output panel (
Ctrl+Shift+U / Cmd+Shift+U)
- Select "PostScript-Preview" from the dropdown
- Output from
==, print, and other operators will appear here
Known Issues
None currently. Report issues here.
Credits
Development
See TESTING.md for local development instructions.
yarn install
yarn compile
# Press F5 in VS Code to launch Extension Development Host
License
MIT
⭐ If you find this extension useful, please star the repo and leave a review!