# 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.
<div class="hsg-featured-snippet">
<h2>C# Print Library</h2>
<ol>
<li><a href="https://www.nuget.org/packages/IronPrint/">Laden Sie die C#-Bibliothek herunter, um Dokumente zu drucken.</a></li>
<li>Unterstützung der Formate PDF, PNG, HTML, TIFF, GIF, JPEG, IMAGE und BITMAP</li>
<li>Druckeinstellungen anpassen</li>
<li>Dialog vor dem Drucken anzeigen</li>
<li>Erkunden Sie die Funktionen der Bibliothek kostenlos in C#</li>
</ol>
</div>
### 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:
```shell
:InstallCmd dotnet add package IronPrint
```
Alternativ direkt von der [offiziellen IronPrint NuGet-Website](https://www.nuget.org/packages/IronPrint) 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:
```csharp
using 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.
```csharp
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);
}
}
```
### Drucken mit Dialogfeld
Verwenden Sie die `ShowPrintDialog` Methode, um das Dokument auszudrucken. Dabei wird vor dem Drucken auch das Druckdialogfenster angezeigt.
```csharp
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);
}
}
```
### Druckeinstellungen 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.
```csharp
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);
}
}
```
## Lizenzierung & Support verfügbar
**IronPrint** ist eine kostenpflichtige Bibliothek; Kostenlose Testlizenzen sind jedoch auch [hier](trial-license) verfügbar.
Für weitere Informationen über Iron Software, besuchen Sie bitte unsere Website: [https://ironsoftware.com/](https://ironsoftware.com/) Für Unterstützung und Anfragen, [fragen Sie unser Team](/contact-us/).
### Unterstützung von Iron Software
Für allgemeinen Support und technische Anfragen senden Sie uns bitte eine E-Mail an: [support@ironsoftware.com](mailto:support@ironsoftware.com).
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.
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 hereLicense.LicenseKey = "your-license-key-here";
using IronPrint;
// Apply your IronPrint license key here
License.LicenseKey = "your-license-key-here";
ImportsIronPrint' Apply your IronPrint license key hereLicense.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 voidMain() { // Specify the file path to be printed string filePath = "document.pdf"; // Invoke the Print method to print the documentIronPrint.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);
}
}
ImportsIronPrintFriend Class ProgramShared Sub Main() ' Specify the file path to be printed Dim filePath AsString = "document.pdf" ' Invoke the Print method to print the documentIronPrint.Print(filePath) End SubEnd Class
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 ShowPrintDialog Methode, um das Dokument auszudrucken. Dabei wird vor dem Drucken auch das Druckdialogfenster angezeigt.
using IronPrint;class Program{ static voidMain() { // Specify the file path to be printed string filePath = "document.pdf"; // Invoke the ShowPrintDialog method to prompt the dialog before printingIronPrint.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);
}
}
ImportsIronPrintFriend Class ProgramShared Sub Main() ' Specify the file path to be printed Dim filePath AsString = "document.pdf" ' Invoke the ShowPrintDialog method to prompt the dialog before printingIronPrint.ShowPrintDialog(filePath) End SubEnd Class
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 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 voidMain() { // 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 settingsIronPrint.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);
}
}
ImportsIronPrintFriend Class ProgramShared Sub Main() ' Create a PrintSettings object to configure printer settings Dim settings As New PrintSettingsWith { .Copies = 2, .Duplex = DuplexMode.Vertical, .PageOrientation = PageOrientation.Landscape } ' Specify the file path to be printed Dim filePath AsString = "document.pdf" ' Invoke the Print method with custom print settingsIronPrint.Print(filePath, settings) End SubEnd Class
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; Kostenlose Testlizenzen sind jedoch auch hier verfügbar.
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.