1. Overview
EPS (Encapsulated PostScript) files are often used for logos, illustrations, charts, and diagrams. We use the .eps file extension for all those files that need to be printed or scaled at high resolution without losing quality.
In this tutorial, we’ll use some special Linux tools such as gv, Evince, GIMP, and others to view or display these files.
2. Using the gv Command-Line Tool
The gv command-line tool is a graphical interface for Ghostscript. We use it to interpret PDF and PostScript files. We can also use gv to display .eps files on Linux and Unix systems.
However, we need to install gv on our system before we can use it. So, let’s install gv using the apt install command:
$ sudo apt install gv
Next, to open and view the .eps file, we use the gv command followed by the filename:
$ gv example.eps
Let’s view the .eps file in the gv command-line tool:
Here, we can perform basic operations on the .eps file such as viewing it in different sizes, printing, and others.
3. Using a Document Viewer Tool
There are several document viewer tools available for Linux that we can use to display .eps files. One such tool is Evince, which is often pre-installed on many Linux distributions.
3.1. Evince
Evince is a document viewer for GNOME, a desktop environment for Linux systems. It can display .eps files without converting them to PDF.
We can install Evince by using the default package manager of our Linux distribution, such as apt, yum, or pacman.
Let’s install Evince using the apt install command:
$ sudo apt install evince
After installing Evince, we can open the .eps file by running the evince command followed by the filename:
$ evince example.eps
Let’s look at the .eps file in the Evince document viewer:
Here, we can view the .eps file in different sizes and zoom levels.
3.2. xdg-open Command
We can also use the xdg-open command to open and display .eps files on Linux. This command can open any file with the default application associated with its file type.
For example, if we have Evince or any other default document viewer installed in our system, we just need to type the xdg-open command followed by the .eps filename.
Let’s open the example.eps file with the default document viewer using the xdg-open command:
$ xdg-open example.eps
Notably, this method will only work if we have a default document viewer installed on our system.
4. Using an Image Editor
An image editor, such as GIMP, Inkscape, and others, can open and edit .eps files along with other file formats, such as JPEG, PNG, GIF, and BMP.
4.1. GIMP
GIMP is a free and open-source image editor that’s available for Windows, Mac, and Linux. We’ll use this application to open and edit .eps files. Additionally, we can also use this tool for manipulating .eps files, such as resizing, cropping, adding text, applying filters, and more.
Let’s first install GIMP using the apt install command:
$ sudo apt install gimp
After installing GIMP, we can now use the gimp command with the .eps filename:
$ gimp example.eps
Let’s display the .eps file in the GIMP image editor:
Once the .eps file is displayed, we can perform various operations on it.
4.2. Inkscape
We can also use Inkscape, a vector graphics editor, to display .eps files. Just like GIMP, it’s also open-source software that offers a wide range of features for creating and editing vector graphics.
The first thing we need is to update our system using the apt update command:
$ sudo apt update
After that, we can install Inkscape using the apt install command:
$ sudo apt install inkscape
Lastly, we use the inkscape command with the filename to open the .eps file:
$ inkscape example.eps
Importantly, we can’t open .eps files with Inkscape if we don’t have Ghostscript on our system. So, we’ll need to install Ghostscript to work with .eps files in Inkscape.
To install Ghostscript, we use the apt install command:
$ sudo apt install ghostscript
After installing Ghostscript, we can use the Inkscape tool to display the .eps file:
Here, we can make changes to the .eps file using different vector graphics tools.
5. Conversion to .pdf
Another way to display .eps files is to convert them to .pdf, a more widely supported file format. We can use online converters, such as CloudConvert or Zamzar, to convert the .eps file to a .pdf file.
Furthermore, *we can also use command-line tools, such as ps2pdf or epstopdf, to convert .eps files to .pdf locally*.
Now, let’s convert the .eps file using the epstopdf tool. We first need to install the texlive distribution using the apt install command:
$ sudo apt install texlive
After installing texlive, we can convert the .eps file into a .pdf file using the epstopdf command:
$ epstopdf example.eps
We have successfully created a .pdf file with the same name as the .eps file in the same directory.
However, we can also save the .pdf file using a distinct name. To achieve this, we need to specify the PDF file name by adding it as a second argument:
$ epstopdf example.eps output.pdf
Lastly, to view the .pdf file, we can use any PDF viewer, such as Adobe Acrobat Reader, Foxit Reader, or Sumatra PDF.
6. Difference Between AI and EPS Files
We often use the AI and EPS file formats while working with vector graphics, such as when creating logos, illustrations, print media, and others. AI file formats are generally created with Adobe Illustrator, which is a popular graphics software. These files are smaller, more detailed, and easier to edit than EPS files.
On the other hand, the EPS file format is an open-source vector graphic format compatible with a wider range of software, including Inkscape, CorelDRAW, and others. Additionally, these files are larger and more flexible than AI files. The EPS format also contains both vector and raster data and often includes more information than AI.
7. Conclusion
In this article, we learned different methods for displaying .eps files on Linux. These methods included using the gv command-line tool, using a document viewer tool, and using an image editor. We also discussed how to convert .eps files to .pdf files using an online tool and a command-line tool.
If we require only displaying or viewing the .eps file, we can use either the gv command-line tool or the xdg-open command followed by the filename. However, if we want to manipulate our .eps file, we generally use an image editor tool such as GIMP or Inkscape.
Ultimately, we can choose any of these methods based on our requirements for displaying and modifying .eps files on Linux.