Last active
July 4, 2024 03:52
-
-
Save aspose-com-kb/1cce34ec677cb32f5cb4448766e23812 to your computer and use it in GitHub Desktop.
Convert EPS to TIFF in C#. The steps of converting EPS to TIFF in C# are given in the following topic: https://kb.aspose.com/page/net/how-to-convert-eps-to-tiff-in-c-sharp/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using System.Drawing.Imaging; | |
| //Add reference to Aspose.Page for .NET API | |
| //Use following namespace to convert EPS to TIFF file type | |
| using Aspose.Page; | |
| using Aspose.Page.EPS; | |
| using Aspose.Page.EPS.Device; | |
| namespace ConvertEPSToTIFF | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| //Set Aspose license before converting EPS to TIFF type | |
| //using Aspose.Page for .NET | |
| Aspose.Page.License AsposePageLicense = new Aspose.Page.License(); | |
| AsposePageLicense.SetLicense(@"c:\asposelicense\license.lic"); | |
| FileStream InputEPSFileToBeConverted = File.Open("EPSFileToBeConverted.eps", FileMode.Open, FileAccess.Read); | |
| PsDocument InputEPSDocument = new PsDocument(InputEPSFileToBeConverted); | |
| ImageDevice TiffImageDevice = new ImageDevice(ImageFormat.Tiff); | |
| SaveOptions saveOptions = new ImageSaveOptions(); | |
| InputEPSDocument.Save(TiffImageDevice, saveOptions); | |
| // Get image bytes array | |
| byte[][] TiffImagesBytes = TiffImageDevice.ImagesBytes; | |
| //loop through image bytes array and add to tiff file | |
| int ImageBytesCount = 0; | |
| foreach (byte[] TiffImageBytes in TiffImagesBytes) | |
| { | |
| using (FileStream OutputTIFFFileConverted = new FileStream("OutputConvertedTIFFFile.tiff", FileMode.Create, FileAccess.Write)) | |
| { | |
| OutputTIFFFileConverted.Write(TiffImageBytes, 0, TiffImageBytes.Length); | |
| } | |
| ImageBytesCount++; | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code is obsolete.