# Getting Started with IronPrint
## IronPrint: Your All-in-One Print Library for .NET
**IronPrint** is a print library developed by Iron Software. The library is compatible with a wide variety of environments, including Windows, macOS, Android, and iOS.
<div class="hsg-featured-snippet">
<h2>C# Print Library</h2>
<ol>
<li><a href="https://www.nuget.org/packages/IronPrint/">Download the C# library to print documents</a></li>
<li>Handle PDF, PNG, HTML, TIFF, GIF, JPEG, IMAGE, BITMAP formats</li>
<li>Customize print settings</li>
<li>Show dialog before printing</li>
<li>Explore the library's features for free in C#</li>
</ol>
</div>
### Compatibility
**IronPrint** has cross-platform support compatibility with:
#### .NET Version Support
- **C#**, **VB.NET**, **F#**
- **.NET 8, 7**, 6, 5, and Core 3.1+
- .NET Framework (4.6.2+)
#### Operating Systems and Environments Support
- **Windows** (7+, Server 2016+)
- **macOS** (10+)
- **iOS** (11+)
- **Android** API 21+ (v5 "Lollipop")
#### .NET Project Types Support
- **Mobile** (Xamarin & MAUI & Avalonia)
- **Desktop** (WPF & MAUI & Windows Avalonia)
- **Console** (App & Library)
## Installation
### IronPrint Library
Install the IronPrint package via NuGet Package Manager:
```shell
:InstallCmd dotnet add package IronPrint
```
Alternatively, download directly from the [official IronPrint NuGet website](https://www.nuget.org/packages/IronPrint).
Once installed, you can get started by adding `using IronPrint;` to the top of your C# code.
## Applying License Key
Next, apply a valid license or trial key to IronPrint by assigning the license key to the `LicenseKey` property of the `License` class. Include the following code right after the import statement, before using any IronPrint methods:
```csharp
using IronPrint;
// Apply your IronPrint license key here
License.LicenseKey = "your-license-key-here";
```
## Code Examples
### Print Document
Simply pass the file path to the `Print` method to print the document.
```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);
}
}
```
### Print With Dialog
Use the `ShowPrintDialog` method to print the document, which also shows the print dialog before printing.
```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);
}
}
```
### Customize Print Settings
To configure the print settings from the code, instantiate the `PrintSettings` class. Configure the `PrintSettings` object and pass it to one of the print methods.
```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);
}
}
```
## Licensing & Support Available
**IronPrint** is a paid library; however, free trial licenses are also available [here](trial-license).
For more information about Iron Software, please visit our website: [https://ironsoftware.com/](https://ironsoftware.com/) For more support and inquiries, please [ask our team](/contact-us/).
### Support from Iron Software
For general support and technical inquiries, please email us at: [support@ironsoftware.com](mailto:support@ironsoftware.com).
IronPrint is a print library developed by Iron Software. The library is compatible with a wide variety of environments, including Windows, macOS, Android, and iOS.
Once installed, you can get started by adding using IronPrint; to the top of your C# code.
Applying License Key
Next, apply a valid license or trial key to IronPrint by assigning the license key to the LicenseKey property of the License class. Include the following code right after the import statement, before using any IronPrint methods:
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"
Code Examples
Print Document
Simply pass the file path to the Print method to print the document.
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
Print With Dialog
Use the ShowPrintDialog method to print the document, which also shows the print dialog before printing.
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
Customize Print Settings
To configure the print settings from the code, instantiate the PrintSettings class. Configure the PrintSettings object and pass it to one of the print methods.
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
Licensing & Support Available
IronPrint is a paid library; however, free trial licenses are also available here.
Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.