Convert TIFF to EPS using .NET
Overview
This article explains how to convert TIFF to EPS using C#. It covers the following topics.
- C# TIFF to EPS
- C# Convert TIFF to EPS
- C# Image to EPS
- C# TIFF from EPS
- C# How to Convert TIFF to EPS Programmatically
- C# Save TIFF as EPS
The Image to EPS conversion using C# from other formats like BMP, JPG, PNG etc. are covered in these articles.
C# TIFF to EPS Conversion
You can check the quality of Aspose.Page TIFF to EPS conversion and view the results via free online TIFF to EPS Converter and than view the resulting EPS file with our EPS Viewer
Steps: TIFF to EPS Converter API Code in C#
It is necessary to do just 2 steps in order to perform TIFF to EPS conversion:
- Create an instance of PsSaveOptions.
- Use static method SaveImageToEps of PsDocument.
SaveImageToEps method has four modifications to provide a user with the most comfortable way to save TIFF image to EPS.
Using strings for saving TIFF to EPS in C#
In the following C# code snippet the input image and the output EPS file are assigned by strings:
1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-.NET
2
3// The path to the documents directory.
4string dataDir = GetDataDir();
5
6// Create default options
7PsSaveOptions options = new PsSaveOptions();
8
9// Save TIFF image to EPS file
10PsDocument.SaveImageAsEps(dataDir + "input1.tiff", dataDir + "output1.eps", options);
Using streams for saving TIFF to EPS in C#
In the following C# code snippet input image and output EPS file are assigned by streams:
1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-.NET
2
3// Create default options
4PsSaveOptions options = new PsSaveOptions();
5
6// Save TIFF image to EPS file
7PsDocument.SaveImageAsEps(inputStream, outputStream, options);
Using Bimap object and string for saving TIFF to EPS in C#
In the following C# code snippet input image is assigned by Bitmap object and the output EPS file is assigned by string:
1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-.NET
2
3// The path to the documents directory.
4string dataDir = GetDataDir();
5
6// Create default options
7PsSaveOptions options = new PsSaveOptions();
8// Create the bitmap object from image file
9using(Bitmap tiff = new Bitmap(File.OpenRead(dataDir + "input1.tiff")))
10{
11 // Save TIFF image to EPS file
12 PsDocument.SaveImageAsEps(tiff, dataDir + "output1.eps", options);
13}
For Linux, MacOS and other non-Windows operation systems we offer to use our Aspose.Page.Drawing Nuget package. It uses Aspose.Drawing backend instead of System.Drawing system library.
So import Aspose.Page.Drawing namespace instead of System.Drawing one. In the above and the following code snippets Aspose.Page.Drawing.Bitmap will be used instead of System.Drawing.Bitmap. Our code examples on GitHub contain all the necessary substitutions.
Using Bimap object and stream for saving TIFF to EPS in C#
In the following C# code snippet input image is assigned by Bitmap object and the output EPS file is assigned by stream:
1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-.NET
2
3// The path to the documents directory.
4string dataDir = GetDataDir();
5
6// Create default options
7PsSaveOptions options = new PsSaveOptions();
8// Create the bitmap object from image file
9using(Bitmap tiff = new Bitmap(File.OpenRead(dataDir + "input1.tiff")))
10{
11 // Create the output stream fo EPS file
12 using(Stream outputStream = File.OpenWrite(dataDir + "output1.eps"))
13 {
14 // Save TIFF image to EPS file
15 PsDocument.SaveImageAsEps(tiff, outputStream, options);
16 }
17}
Evaluate TIFF to EPS conversion online on our TIFF to EPS Converter. You can convert several TIFF image to EPS files at once and dowload results in a few seconds.
You can download examples and data files from GitHub.