For more details, please visit Convert EPS Postscript File to TIFF, EMF, or WMF Image in C#
Last active
December 23, 2021 06:13
-
-
Save aspose-com-gists/168ae56215fcc24740a532012f9a71c8 to your computer and use it in GitHub Desktop.
Convert EPS Postscript File to TIFF, EMF, or WMF Image Programmatically using C#
This file contains 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
// create a stream for input EPS file | |
using (var psStream = new System.IO.FileStream("Sample.eps", System.IO.FileMode.Create, System.IO.FileAccess.Read)) | |
{ | |
// create a stream for output EMF file | |
using (var pdfStream = System.IO.File.Open("output.emf", System.IO.FileMode.Open, System.IO.FileAccess.Write)) | |
{ | |
// load the EPS file from stream | |
var document = new Aspose.Page.EPS.PsDocument(psStream); | |
// create an instance of ImageSaveOptions | |
var options = new Aspose.Page.EPS.Device.ImageSaveOptions(); | |
// create rendering device for EMF | |
var device = new Aspose.Page.EPS.Device.ImageDevice(System.Drawing.Imaging.ImageFormat.Emf); | |
// Convert EPS to EMF Image | |
document.Save(device, options); | |
} | |
} |
This file contains 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
// create a stream for input EPS file | |
using (var epsStream = new FileStream("Sample.eps", FileMode.Create, FileAccess.Read)) | |
{ | |
// create a stream for output TIFF file | |
using (var tiffStream = File.Open("output.tiff", FileMode.Open, FileAccess.Write)) | |
{ | |
// load the EPS file from stream | |
var document = new Aspose.Page.EPS.PsDocument(epsStream); | |
// create an instance of ImageSaveOptions | |
var options = new Aspose.Page.EPS.Device.ImageSaveOptions(); | |
// create rendering device for TIFF | |
var device = new Aspose.Page.EPS.Device.ImageDevice(System.Drawing.Imaging.ImageFormat.Tiff); | |
// Convert EPS to TIFF Image | |
document.Save(device, options); | |
} | |
} |
This file contains 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
// create a stream for input EPS file | |
using (var psStream = new System.IO.FileStream("Sample.eps", System.IO.FileMode.Create, System.IO.FileAccess.Read)) | |
{ | |
// create a stream for output WMF file | |
using (var pdfStream = System.IO.File.Open("output.wmf", System.IO.FileMode.Open, System.IO.FileAccess.Write)) | |
{ | |
// load the EPS file from stream | |
var document = new Aspose.Page.EPS.PsDocument(psStream); | |
// create an instance of ImageSaveOptions | |
var options = new Aspose.Page.EPS.Device.ImageSaveOptions(); | |
// create rendering device for WMF | |
var device = new Aspose.Page.EPS.Device.ImageDevice(System.Drawing.Imaging.ImageFormat.Wmf); | |
// Convert EPS to WMF Image | |
document.Save(device, options); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment