IronPrint ile Başlarken
T[98] ## IronPrint: .NET için Hepsi Bir Arada Yazdırma Kütüphaneniz
IronPrint, Iron Software tarafından geliştirilen bir yazdırma kütüphanesidir. Kütüphane, Windows, macOS, Android ve iOS dahil olmak üzere birçok ortamla uyumludur.
C# Yazdırma Kütüphanesi
- Belgeleri yazdırmak için C# kütüphanesini indirin
- PDF, PNG, HTML, TIFF, GIF, JPEG, GÖRÜNTÜ, BITMAP formatlarını işleyin
- Yazdırma ayarlarını özelleştirin
- Yazdırmadan önce diyalogu göster
- C#'ta kütüphanenin özelliklerini ücretsiz olarak keşfedin
Uyumluluk
IronPrint, şu platformlar arası destek uyumluluğuna sahiptir:
.NET Sürüm Desteği
- C#, VB.NET, F#
- .NET 8, 7, 6, 5 ve Core 3.1+
- .NET Framework (4.6.2+)
İşletim Sistemleri ve Ortamlara Dair Destek
- Windows (7+, Sunucu 2016+)
- macOS (10+)
- iOS (11+)
- Android API 21+ (v5 "Lollipop")
.NET Proje Tipleri Desteği
- Mobil (Xamarin & MAUI & Avalonia)
- Masaüstü (WPF & MAUI & Windows Avalonia)
- Konsol (Uygulama & Kütüphane)
Kurulum
IronPrint Kütüphanesi
NuGet Paket Yöneticisi aracılığıyla IronPrint paketini yükleyin:
dotnet add package IronPrint
Alternatif olarak, doğrudan resmi IronPrint NuGet web sitesinden indirin.
Kurulduktan sonra, C# kodunuzun üst kısmına using IronPrint; ekleyerek başlayabilirsiniz.
Lisans Anahtarı Uygulama
Ardından, lisans anahtarını License sınıfının LicenseKey özelliğine atayarak IronPrint için geçerli bir lisans veya deneme anahtarı uygulayın. Herhangi bir IronPrint yöntemini kullanmadan önce, içe aktarma ifadesinin hemen arkasından aşağıdaki kodu ekleyin:
using IronPrint;
// Apply your IronPrint license key here
License.LicenseKey = "your-license-key-here";
using IronPrint;
// Apply your IronPrint license key here
License.LicenseKey = "your-license-key-here";
Imports IronPrint
' Apply your IronPrint license key here
License.LicenseKey = "your-license-key-here"
Kod Örnekleri
Belge Yazdır
Dosya yolunu Print yöntemine geçirin, belgeyi yazdırmak için.
using IronPrint;
class Program
{
static void Main()
{
// Specify the file path to be printed
string filePath = "document.pdf";
// Invoke the Print method to print the document
IronPrint.Print(filePath);
}
}
using IronPrint;
class Program
{
static void Main()
{
// Specify the file path to be printed
string filePath = "document.pdf";
// Invoke the Print method to print the document
IronPrint.Print(filePath);
}
}
Imports IronPrint
Friend Class Program
Shared Sub Main()
' Specify the file path to be printed
Dim filePath As String = "document.pdf"
' Invoke the Print method to print the document
IronPrint.Print(filePath)
End Sub
End Class
Diyalog ile Yazdır
Belgeyi yazdırmak için ShowPrintDialog yöntemini kullanın, bu yöntem ayrıca yazdırmadan önce yazdırma iletişim kutusunu gösterir.
using IronPrint;
class Program
{
static void Main()
{
// Specify the file path to be printed
string filePath = "document.pdf";
// Invoke the ShowPrintDialog method to prompt the dialog before printing
IronPrint.ShowPrintDialog(filePath);
}
}
using IronPrint;
class Program
{
static void Main()
{
// Specify the file path to be printed
string filePath = "document.pdf";
// Invoke the ShowPrintDialog method to prompt the dialog before printing
IronPrint.ShowPrintDialog(filePath);
}
}
Imports IronPrint
Friend Class Program
Shared Sub Main()
' Specify the file path to be printed
Dim filePath As String = "document.pdf"
' Invoke the ShowPrintDialog method to prompt the dialog before printing
IronPrint.ShowPrintDialog(filePath)
End Sub
End Class
Yazdırma Ayarlarını Özelleştirme
Yazdırma ayarlarını koddan yapılandırmak için PrintSettings sınıfını oluşturun. PrintSettings nesnesini yapılandırın ve yazdırma yöntemlerinden birine aktarın.
using IronPrint;
class Program
{
static void Main()
{
// Create a PrintSettings object to configure printer settings
PrintSettings settings = new PrintSettings
{
Copies = 2,
Duplex = DuplexMode.Vertical,
PageOrientation = PageOrientation.Landscape
};
// Specify the file path to be printed
string filePath = "document.pdf";
// Invoke the Print method with custom print settings
IronPrint.Print(filePath, settings);
}
}
using IronPrint;
class Program
{
static void Main()
{
// Create a PrintSettings object to configure printer settings
PrintSettings settings = new PrintSettings
{
Copies = 2,
Duplex = DuplexMode.Vertical,
PageOrientation = PageOrientation.Landscape
};
// Specify the file path to be printed
string filePath = "document.pdf";
// Invoke the Print method with custom print settings
IronPrint.Print(filePath, settings);
}
}
Imports IronPrint
Friend Class Program
Shared Sub Main()
' Create a PrintSettings object to configure printer settings
Dim settings As New PrintSettings With {
.Copies = 2,
.Duplex = DuplexMode.Vertical,
.PageOrientation = PageOrientation.Landscape
}
' Specify the file path to be printed
Dim filePath As String = "document.pdf"
' Invoke the Print method with custom print settings
IronPrint.Print(filePath, settings)
End Sub
End Class
Lisanslama ve Destek Mevcuttur
IronPrint ücretli bir kütüphanedir; ancak, buradan ücretsiz deneme lisansları da mevcuttur.
Iron Software hakkında daha fazla bilgi için lütfen web sitemizi ziyaret edin: https://ironsoftware.com/ Daha fazla destek ve sorular için lütfen ekibimize sorun.
Iron Software'dan Destek
Genel destek ve teknik sorular için lütfen bize şu e-posta adresinden yazın: support@ironsoftware.com.

