Skip to content

💻 PostScript Preview is an extension that helps to preview EPS and PS files in Visual Studio Code.

License

Notifications You must be signed in to change notification settings

ahnafnafee/PostScript-Preview

Repository files navigation

Version Rating Installs

Logo


Read Requirements After Install

PostScript Preview

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.

Features

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.

demo

Requirements

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.

macOS

You can install them via homebrew:

brew install ghostscript

Ubuntu

You can install them using the following commands:

sudo apt-get install ghostscript -y

Windows

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 -y

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.

Known Issues

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.

Credits

About

💻 PostScript Preview is an extension that helps to preview EPS and PS files in Visual Studio Code.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published