Aspose.Total for .NET kullanarak CGM dosyasını herhangi bir .NET, C#, ASP.NET ve VB.NET uygulamasında kolayca TXT’ye dönüştürebilirsiniz. İlk olarak, Aspose.PDF for .NET kullanarak CGM’yi XLSX’e aktarabilirsiniz. Bundan sonra, Aspose.Cells for .NET Elektronik Tablo Programlama API’sini kullanarak XLSX’i TXT’ye dönüştürebilirsiniz.
CGM'yi TXT'ye Dönüştürmek için .NET API
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, SVG, XPS, MD, MHTML, XML, and XSLFO file format | |
// load PDF as input file format with an instance of Document class | |
var document = new Document("template.pdf"); | |
// save document in XLSX format | |
document.Save("excel_output.xlsx", Aspose.Pdf.SaveFormat.Xlsx); | |
// load the XLSX file in an instance of Workbook | |
var book = new Workbook("excel_output.xlsx"); | |
// supports XLSB, XLSM, XLT, XLTX, XLTM, XLAM, CSV, TSV, TXT, ODS, DIF, MD, SXC, and FODS file format | |
// save input document as CSV | |
book.Save("output.csv", Aspose.Cells.SaveFormat.Auto); |
Korumalı CGM'yi C# ile TXT'ye Dönüştür
CGM belgeniz parola korumalıysa, parola olmadan TXT’ye dönüştüremezsiniz. API’yi kullanarak, korumalı belgeyi önce geçerli bir şifre kullanarak açabilir ve ardından dönüştürebilirsiniz. Şifrelenmiş dosyayı açmak için Document sınıfının yeni bir örneğini başlatabilir ve dosya adını ve parolayı argüman olarak iletebilirsiniz.
// supports PDF, CGM, EPUB, TeX, PCL, PS, SVG, XPS, MD, MHTML, XML, and XSLFO input file formats | |
// open password protected PDF document | |
Document doc = new Document("input.pdf", "Your@Password"); | |
// save document in XLSX format | |
document.Save("excel_output.xlsx", Aspose.Pdf.SaveFormat.Xlsx); | |
// load the XLSX file in an instance of Workbook | |
var book = new Workbook("excel_output.xlsx"); | |
// supports XLSB, XLSM, XLT, XLTX, XLTM, XLAM, CSV, TSV, TXT, ODS, DIF, MD, SXC, and FODS file format | |
// save input document as CSV | |
book.Save("output.csv", Aspose.Cells.SaveFormat.Auto); |
CGM Dosyasını C# ile Filigran ile TXT'ye Dönüştürün
CGM dosyasını TXT’ye dönüştürürken, çıktı TXT dosya biçiminize filigran da ekleyebilirsiniz. Filigran eklemek için yeni bir Çalışma Kitabı nesnesi oluşturabilir ve dönüştürülmüş XLSX belgesini açabilir, dizini aracılığıyla Çalışma Sayfası’nı seçebilir, bir Şekil oluşturabilir ve AddTextEffect işlevini kullanabilirsiniz. Bundan sonra XLSX belgenizi Filigranlı TXT olarak kaydedebilirsiniz.
// supports PDF, CGM, EPUB, TeX, PCL, PS, SVG, XPS, MD, MHTML, XML, and XSLFO file format | |
// load PDF as input file format with an instance of Document class | |
var document = new Document("template.pdf"); | |
// save document in XLSX format | |
document.Save("excel_output.xlsx", Aspose.Pdf.SaveFormat.Xlsx); | |
// load the XLSX file in an instance of Workbook | |
var book = new Workbook("excel_output.xlsx"); | |
// get the first default sheet | |
var sheet = book.Worksheets[0]; | |
// add a new shape to ShapesCollection of Worksheet | |
var wordart = sheet.Shapes.AddTextEffect(Aspose.Cells.Drawing.MsoPresetTextEffect.TextEffect1, | |
"CONFIDENTIAL", "Arial Black", 50, false, true, 18, 8, 1, 1, 130, 800); | |
// supports XLSB, XLSM, XLT, XLTX, XLTM, XLAM, CSV, TSV, TXT, ODS, DIF, MD, SXC, and FODS file format | |
// save input document as CSV | |
book.Save("output.csv", Aspose.Cells.SaveFormat.Auto); |