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.
Biblioteka drukowania C#
- Pobierz bibliotekę C# do drukowania dokumentów
- Obsługa formatów PDF, PNG, HTML, TIFF, GIF, JPEG, IMAGE, BITMAP
- Dostosuj ustawienia drukowania
- Pokaż okno dialogowe przed drukowaniem
- Odkrywaj funkcje biblioteki za darmo w C#
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:
Alternatywnie, pobierz bezpośrednio z oficjalnej strony NuGet IronPrint.
Po zainstalowaniu, możesz rozpocząć, dodając using IronPrint; na górze swojego kodu C#.
Stosowanie klucza licencyjnego
Następnie, zastosuj ważną licencję lub klucz próbny do IronPrint, przypisując klucz licencyjny do właściwości 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 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"Przykłady kodu
Drukuj Dokument
Po prostu przekaż ścieżkę do pliku do metody Print, aby wydrukować dokument.
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 ClassDrukuj z dialogiem
Użyj metody ShowPrintDialog, aby wydrukować dokument, która również wyświetla okno dialogowe drukowania przed drukowaniem.
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 ClassDostosuj Ustawienia Drukowania
Aby skonfigurować ustawienia drukowania z poziomu kodu, utwórz instancję klasy PrintSettings. Skonfiguruj obiekt PrintSettings i przekaż go do jednej z metod drukowania.
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 ModuleLicencjonowanie i wsparcie dostępne
IronPrint to płatna biblioteka; jednak darmowe licencje próbne są również dostępne tutaj.
Aby uzyskać więcej informacji o Iron Software, odwiedź naszą stronę internetową: https://ironsoftware.com/ Aby uzyskać więcej wsparcia i zapytań, prosimy pytać nasz zespół.
Wsparcie od Iron Software
W przypadku ogólnej pomocy i zapytań technicznych, prosimy o kontakt e-mailowy: support@ironsoftware.com.
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.