PostScript Preview is an extension that helps to preview EPS and PS files in Visual Studio Code. It supercharges how your view PostScript files by also allowing to pan and zoom the image. You can also change the preview background for extra customizations.
This extension enables the in-VSCode preview of EPS image files.
A new command postscript-preview.sidePreview
is added as well as a preview icon in the menu bar when EPS or PS files are open in VSCode.
This extension depends on the PostScript Language
extension to recognize EPS/PS file.
You can install that extension from the VSCode extension store.
This extension also depends on two commands:
ps2pdf
- to first convert the EPS/PS file to PDF (the command is part of GhostScript)pdftocairo
- to convert the generated pdf to svg which is shown in the preview
Thus you need to install these two commands first and ensure they are in the executable path.
You can install them via homebrew:
brew install ghostscript
brew install poppler
You can install them using the following commands:
sudo apt-get install ghostscript -y
sudo apt-get install poppler-utils -y
You need to have GhostScript installed in your system. You can install them via Chocolatey. Run the following commands using an Administrative PowerShell.
Installs GhostScript for ps2pdf
choco install ghostscript --version 9.55.0 --force -y
Installs pdftocairo
choco install poppler --version 0.89.0 -y --force
Adds the executables to the environment 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)
Now restart VSCode. You should now be able to view the EPS/PS files in the preview.
If you are having issues setting the PATH, you can set it using the GUI instead as described here. The paths that need to be added are:
C:\Program Files\gs\gs9.55.0\lib
C:\Program Files\gs\gs9.55.0\bin
C:\ProgramData\chocolatey\lib\poppler\tools
Please verify that you can view files in the above folders. If the folders do not exist, you might have run into issues with your installation. It's good to close Logitech GHUB and Logitech GHUB Updater when you install these as they might interfere with the process.
None yet. If you run into issues, please report them here: https://github.com/ahnafnafee/PostScript-Preview/issues
You are also encouraged to open pull requests for additional features and fixes you want to add to this extension.
- mkvoya/eps-preview for the original base extension
- bumbu/svg-pan-zoom for the SVG Pan Zoom library
- Simonwep/pickr for the color picker library
Install the VSCode Publishing Extension
npm install -g @vscode/vsce
Package the extension:
vsce package
Publish the extension:
vsce publish
See published extensions here: https://marketplace.visualstudio.com/manage