# Rozpocznij pracę z IronPrint
## IronPrint: Twoja wszechstronna biblioteka drukowania dla .NET
**IronPrint** to biblioteka do drukowania opracowana przez Iron Software. Biblioteka jest kompatybilna z szeroką gamą środowisk, w tym Windows, macOS, Android i iOS.
<div class="hsg-featured-snippet">
<h2>Biblioteka drukowania C#</h2>
<ol>
<li><a href="https://www.nuget.org/packages/IronPrint/">Pobierz bibliotekę C# do drukowania dokumentów</a></li>
<li>Obsługa formatów PDF, PNG, HTML, TIFF, GIF, JPEG, IMAGE, BITMAP</li>
<li>Dostosuj ustawienia drukowania</li>
<li>Pokaż okno dialogowe przed drukowaniem</li>
<li>Odkrywaj funkcje biblioteki za darmo w C#</li>
</ol>
</div>
### Kompatybilność
**IronPrint** ma wsparcie dla kompatybilności międzyplatformowej z:
#### Wsparcie dla wersji .NET
- **C#**, **VB.NET**, **F#**
- **.NET 8, 7**, 6, 5 i Core 3.1+
- .NET Framework (4.6.2+)
#### Wsparcie dla systemów operacyjnych i środowisk
- **Windows** (7+, Server 2016+)
- **macOS** (10+)
- **iOS** (11+)
- **Android** API 21+ (wersja 5 "Lollipop")
#### Wsparcie dla typów projektów .NET
- **Mobilne** (Xamarin & MAUI & Avalonia)
- **Desktopowe** (WPF & MAUI & Windows Avalonia)
- **Konsolowe** (Aplikacja & Biblioteka)
## Instalacja
### Biblioteka IronPrint
Zainstaluj pakiet IronPrint za pomocą Menedżera pakietów NuGet:
```shell
:InstallCmd dotnet add package IronPrint
```
Alternatywnie, pobierz bezpośrednio z [oficjalnej strony IronPrint w serwisie NuGet](https://www.nuget.org/packages/IronPrint).
Po zainstalowaniu mozna rozpoczac, dodajac `using IronPrint;` na poczatku swojego kodu C#.
## Stosowanie klucza licencyjnego
Nastepnie zastosuj wazny klucz licencyjny lub klucz trial do IronPrint, przypisujac klucz licencyjny do wlasciwosci `LicenseKey` klasy `License`. Zawierać następujący kod zaraz po instrukcji importu, przed użyciem jakichkolwiek metod IronPrint:
```csharp
using IronPrint;
// Apply your IronPrint license key here
License.LicenseKey = "your-license-key-here";
```
## Przykłady kodu
### Drukuj Dokument
Wystarczy przekazac sciezke pliku do metody `Print`, aby wydrukowac dokument.
```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);
}
}
```
### Drukuj z dialogiem
Uzyj metody `ShowPrintDialog`, aby wydrukowac dokument, co rowniez pokazuje dialog drukowania przed drukowaniem.
```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);
}
}
```
### Dostosuj Ustawienia Drukowania
Aby skonfigurowac ustawienia drukowania z poziomu kodu, utworz instancje klasy `PrintSettings`. Skonfiguruj obiekt `PrintSettings` i przekaz go do jednej z metod drukowania.
```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);
}
}
```
## Licencjonowanie i wsparcie dostępne
**IronPrint** to płatna biblioteka; jednakże, darmowe licencje próbne są również dostępne [tutaj](trial-license).
Więcej informacji o Iron Software znajdziesz na naszej stronie internetowej: [https://ironsoftware.com/](https://ironsoftware.com/) Więcej wsparcia i zapytań: [zapytaj nasz zespół](/contact-us/).
### Wsparcie od Iron Software
W przypadku ogólnego wsparcia i zapytań technicznych, napisz do nas e-mail: [support@ironsoftware.com](mailto:support@ironsoftware.com).
IronPrint: Twoja wszechstronna biblioteka drukowania dla .NET
IronPrint to biblioteka do drukowania opracowana przez Iron Software. Biblioteka jest kompatybilna z szeroką gamą środowisk, w tym Windows, macOS, Android i iOS.
Po zainstalowaniu mozna rozpoczac, dodajac using IronPrint; na poczatku swojego kodu C#.
Stosowanie klucza licencyjnego
Nastepnie zastosuj wazny klucz licencyjny lub klucz trial do IronPrint, przypisujac klucz licencyjny do wlasciwosci LicenseKey klasy License. Zawierać następujący kod zaraz po instrukcji importu, przed użyciem jakichkolwiek metod IronPrint:
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"
Przykłady kodu
Drukuj Dokument
Wystarczy przekazac sciezke pliku do metody Print, aby wydrukowac dokument.
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
Drukuj z dialogiem
Uzyj metody ShowPrintDialog, aby wydrukowac dokument, co rowniez pokazuje dialog drukowania przed drukowaniem.
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
Dostosuj Ustawienia Drukowania
Aby skonfigurowac ustawienia drukowania z poziomu kodu, utworz instancje klasy PrintSettings. Skonfiguruj obiekt PrintSettings i przekaz go do jednej z metod drukowania.
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
Licencjonowanie i wsparcie dostępne
IronPrint to płatna biblioteka; jednakże, darmowe licencje próbne są również dostępne tutaj.
Curtis Chau posiada tytuł licencjata z informatyki (Uniwersytet Carleton) i specjalizuje się w front-endowym rozwoju, z ekspertką w Node.js, TypeScript, JavaScript i React. Pasjonuje się tworzeniem intuicyjnych i estetycznie przyjemnych interfejsów użytkownika, Curtis cieszy się pracą z nowoczesnymi frameworkami i tworzeniem dobrze zorganizowanych, atrakcyjnych wizualnie podręczników.