Erste Schritte mit IronPrint
IronPrint: Ihre All-In-One Druckbibliothek für .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:
Alternativ direkt von der offiziellen IronPrint NuGet-Website herunterladen.
Sobald installiert, können Sie beginnen, indem Sie using IronPrint; an den Anfang Ihres C#-Codes hinzufügen.
Lizenzschlüssel anwenden
Anschließend wenden Sie einen gültigen Lizenz- oder Testschlüssel auf IronPrint an, indem Sie den Lizenzschlüssel der LicenseKey Eigenschaft der License Klasse 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";Imports 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 Print Methode, um das Dokument auszudrucken.
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 ClassImports 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 ClassDrucken mit Dialogfeld
Verwenden Sie die ShowPrintDialog Methode, um das Dokument auszudrucken. Dabei wird vor dem Drucken auch das Druckdialogfenster 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 ClassImports 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 ClassDruckeinstellungen anpassen
Um die Druckeinstellungen aus dem Code zu konfigurieren, instanziieren Sie die PrintSettings Klasse. Konfigurieren Sie das PrintSettings Objekt und übergeben Sie es an eine der Druckmethoden.
using IronPrint;
class Program
{
static void Main()
{
// Create a PrintSettings object to configure printer settings
PrintSettings settings = new PrintSettings
{
NumberOfCopies = 2,
PaperOrientation = PaperOrientation.Landscape
};
// Specify the file path to be printed
string filePath = "document.pdf";
// Invoke the Print method with custom print settings
Printer.Print(filePath, settings);
}
}using IronPrint;
class Program
{
static void Main()
{
// Create a PrintSettings object to configure printer settings
PrintSettings settings = new PrintSettings
{
NumberOfCopies = 2,
PaperOrientation = PaperOrientation.Landscape
};
// Specify the file path to be printed
string filePath = "document.pdf";
// Invoke the Print method with custom print settings
Printer.Print(filePath, settings);
}
}Imports IronPrint
Module Program
Sub Main()
' Create a PrintSettings object to configure printer settings
Dim settings As New PrintSettings With {
.NumberOfCopies = 2,
.PaperOrientation = PaperOrientation.Landscape
}
' Specify the file path to be printed
Dim filePath As String = "document.pdf"
' Invoke the Print method with custom print settings
Printer.Print(filePath, settings)
End Sub
End ModuleImports IronPrint
Module Program
Sub Main()
' Create a PrintSettings object to configure printer settings
Dim settings As New PrintSettings With {
.NumberOfCopies = 2,
.PaperOrientation = PaperOrientation.Landscape
}
' Specify the file path to be printed
Dim filePath As String = "document.pdf"
' Invoke the Print method with custom print settings
Printer.Print(filePath, settings)
End Sub
End ModuleLizenzierung & Support verfügbar
IronPrint ist eine kostenpflichtige Bibliothek; Kostenlose Testlizenzen sind jedoch 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.
Curtis Chau hat einen Bachelor-Abschluss in Informatik von der Carleton University und ist spezialisiert auf Frontend-Entwicklung mit Expertise in Node.js, TypeScript, JavaScript und React. Leidenschaftlich widmet er sich der Erstellung intuitiver und ästhetisch ansprechender Benutzerschnittstellen und arbeitet gerne mit modernen Frameworks sowie der Erstellung gut strukturierter, optisch ansprechender Handbücher.