Erste Schritte mit IronPrint
IronPrint: Ihre All-In-One Druckbibliothek for .NET
IronPrint ist eine Druckbibliothek, die von Iron Software entwickelt wurde. Die Bibliothek ist kompatibel mit einer Vielzahl von Umgebungen, einschließlich Windows, macOS, Android und iOS.
C# Print Library
- Laden Sie die C#-Bibliothek herunter, um Dokumente zu drucken.
- Unterstützung der Formate PDF, PNG, HTML, TIFF, GIF, JPEG, IMAGE und BITMAP
- Druckeinstellungen anpassen
- Dialog vor dem Drucken anzeigen
- Erkunden Sie die Funktionen der Bibliothek kostenlos in C#
Kompatibilität
IronPrint hat plattformübergreifende Unterstützungskompatibilität mit:
.NET Version Unterstützung
- C#, VB.NET, F#
- .NET 8, 7, 6, 5, und Core 3.1+
- .NET Framework (4.6.2+)
Unterstützung für Betriebssysteme und Umgebungen
- Windows (7+, Server 2016+)
- macOS (10+)
- iOS (11+)
- Android API 21+ (v5 "Lollipop")
.NET Projekttypen Unterstützung
- Mobil (Xamarin & MAUI & Avalonia)
- Desktop (WPF & MAUI & Windows Avalonia)
- Konsole (App & Bibliothek)
Installation
IronPrint Bibliothek
Installieren Sie das IronPrint-Paket über den NuGet-Paket-Manager:
dotnet add package IronPrint
Alternativ direkt von der offiziellen IronPrint NuGet-Website herunterladen.
Nach der Installation können Sie loslegen, indem Sie using IronPrint; am Anfang Ihres C#-Codes hinzufügen.
Lizenzschlüssel anwenden
Als Nächstes wenden Sie einen gültigen Lizenz- oder Testschlüssel auf IronPrint an, indem Sie den Lizenzschlüssel der Eigenschaft LicenseKey der Klasse License zuweisen. Fügen Sie den folgenden Code direkt nach der Importanweisung hinzu, bevor Sie IronPrint-Methoden verwenden:
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"
Beispiele für Code
Dokument drucken
Übergeben Sie einfach den Dateipfad an die Methode Print, um das Dokument zu drucken.
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
Drucken mit Dialogfeld
Verwenden Sie die Methode ShowPrintDialog, um das Dokument zu drucken. Dabei wird vor dem Drucken auch der Druckdialog angezeigt.
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
Druckeinstellungen anpassen
Um die Druckeinstellungen aus dem Code heraus zu konfigurieren, instanziieren Sie die Klasse PrintSettings. Konfigurieren Sie das PrintSettings-Objekt und übergeben Sie es an eine der print-Methoden.
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
Lizenzierung & Support verfügbar
IronPrint ist eine kostenpflichtige Bibliothek, jedoch sind kostenlose Testlizenzen auch hier verfügbar.
Für weitere Informationen über Iron Software, besuchen Sie bitte unsere Website: https://ironsoftware.com/ Für Unterstützung und Anfragen, fragen Sie unser Team.
Unterstützung von Iron Software
Für allgemeinen Support und technische Anfragen senden Sie uns bitte eine E-Mail an: support@ironsoftware.com.

