Aspose.Total for .NET kullanarak, iki basit adımda herhangi bir .NET uygulamasında CGM’yi EMZ görüntüsüne kolayca aktarabilirsiniz. Her şeyden önce, Aspose.PDF for .NET kullanarak CGM’yi JPEG’e aktarabilirsiniz. Bundan sonra, Aspose.Imaging for .NET Görüntü İşleme API’sini kullanarak JPEG’i EMZ’ye dönüştürebilirsiniz.
CGM dosyasını .NET aracılığıyla EMZ'ye dönüştürün
- Document sınıfını kullanarak CGM dosyasını açın
- JpegDevice sınıf nesnesini başlatın ve Process yöntemi
- Image sınıfını kullanarak JPEG dosyasını yükleyin
- Save yöntemini kullanarak belgeyi EMZ formatına kaydedin
Dönüşüm Gereksinimleri
Komut satırından nuget install Aspose.Total
veya Visual Studio’nun Paket Yönetici Konsolu üzerinden ```Install-Package Aspose.Total`` ile kurun.
Alternatif olarak, çevrimdışı MSI yükleyicisini veya DLL’leri indirilenler adresinden bir ZIP dosyasında alın.
// supports PDF, CGM, EPUB, TeX, PCL, PS, XPS, MD, MHTML, XSLFO, HTML file formats | |
// load PDF with an instance of Document | |
var document = new Document("input.pdf"); | |
// create an object of jpegDevice | |
var renderer = new JpegDevice(); | |
// convert a particular page and save the image in JPEG format | |
renderer.Process(document.Pages[1], "output.jpeg"); | |
// load JPEG file | |
var image = Image.Load("output.jpeg"); | |
// supports Dicom, Jpeg2000, Apng, Psd, Dxf, Wmf, Emz, Wmz, Tga, Svgz file formats | |
// save JPEG to PSD file format | |
image.Save("output.psd", new PsdOptions()); |
C# ile CGM Dosyasını Tek Bir Dosyada EMZ'ye Dönüştürün
API’yi kullanarak, CGM dosyasını EMZ’ye tek bir görüntü dosyasına da dönüştürebilirsiniz. Tüm sayfaları dönüştürmek için önce CGM belgenizi bir TIFF dosyasına dönüştürebilir ve ardından TIFF dosyasını EMZ’ye aktarabilirsiniz. Giriş dosyasını Document sınıfını kullanarak açabilir ve Resolution, TiffSettings ve TIFF aygıt nesneleri oluşturabilirsiniz. Process TiffDevice yöntemini kullanarak tek bir TIFF görüntüsü alabilirsiniz. apireference.aspose.com/pdf/net/aspose.pdf.devices/tiffdevice) sınıfı. Son olarak, Image sınıfını kullanarak TIFF dosyasını yükleyebilirsiniz. ve Save yöntemini kullanarak EMZ formatına kaydedin.
// supports PDF, CGM, EPUB, TeX, PCL, PS, XPS, MD, MHTML, XSLFO, HTML file formats | |
// Open PDF document | |
Document pdfDocument = new Document("input.pdf"); | |
// Create Resolution object | |
Resolution resolution = new Resolution(300); | |
// Create TiffSettings object | |
TiffSettings tiffSettings = new TiffSettings | |
{ | |
Compression = CompressionType.None, | |
Depth = ColorDepth.Default, | |
Shape = ShapeType.Landscape, | |
SkipBlankPages = false | |
}; | |
// Create TIFF device | |
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings); | |
// Convert a particular page and save the image to stream | |
tiffDevice.Process("output.tif"); | |
// load TIFF file | |
var image = Image.Load("output.tif"); | |
// supports Dicom, Jpeg2000, Apng, Psd, Dxf, Wmf, Emz, Wmz, Tga, Svgz file formats | |
// save TIFF to PSD file format | |
image.Save("output.psd", new PsdOptions()); |
CGM Dosyasını C# ile EMZ'ye Dönüştür ve Döndür
API’yi kullanarak, çıktı EMZ görüntüsünü ihtiyaçlarınıza göre de döndürebilirsiniz. Image.RotateFlip yöntemi, görüntüyü 90/180/270 derece döndürmek ve görüntüyü yatay veya dikey olarak çevirmek için kullanılabilir. Görüntüye uygulamak için döndürme ve çevirme türünü belirtebilirsiniz. Görüntüyü döndürmek ve çevirmek için Image sınıfı tarafından sunulan fabrika yöntemini kullanarak dönüştürülmüş JPEG görüntüsünü yükleyebilir ve Görüntüyü çağırabilirsiniz. .RotateFlip yöntemi, uygun RotateFlipType belirtilirken.
// supports PDF, CGM, EPUB, TeX, PCL, PS, XPS, MD, MHTML, XSLFO, HTML file formats | |
// load PDF with an instance of Document | |
var document = new Document("input.pdf"); | |
// create an object of jpegDevice | |
var renderer = new JpegDevice(); | |
// convert a particular page and save the image in JPEG format | |
renderer.Process(document.Pages[1], "output.jpeg"); | |
// load JPEG file | |
var image = Image.Load("output.jpeg"); | |
// rotate the image | |
image.RotateFlip(RotateFlipType.Rotate270FlipNone); | |
// supports Dicom, Jpeg2000, Apng, Psd, Dxf, Wmf, Emz, Wmz, Tga, Svgz file formats | |
// save JPEG to PSD file format | |
image.Save("output.psd", new PsdOptions()); |