IronPrintを使い始める
IronPrint: .NET 向けオールインワン印刷ライブラリ
IronPrint は、Iron Software によって開発された印刷ライブラリです。 このライブラリは、Windows、macOS、Android、iOS など、さまざまな環境と互換性があります。
C# Print Library
- ドキュメントを印刷するためのC#ライブラリをダウンロードする
- PDF、PNG、HTML、TIFF、GIF、JPEG、IMAGE、BITMAP 形式を処理できます
- 印刷設定をカスタマイズする
- 印刷前にダイアログを表示する
- C#でライブラリの機能を無料で試す
互換性
IronPrint は、以下のプラットフォームとのクロスプラットフォーム サポート互換性を備えています。
.NET バージョンのサポート
- C#、VB.NET、F#
- .NET 8、7、6、5 、および Core 3.1 以上
- .NET Framework (4.6.2+)
オペレーティングシステムと環境のサポート
- Windows (7以降、Server 2016以降)
- macOS (10+)
- iOS (11以上)
- Android API 21+ (v5 "Lollipop")
.NET プロジェクトタイプのサポート
-モバイル(Xamarin & MAUI & Avalonia) -デスクトップ(WPF & MAUI & Windows Avalonia)
- コンソール (App & ライブラリ)
インストール
IronPrintライブラリ
NuGet パッケージ マネージャーを使用して IronPrint パッケージをインストールします。
dotnet add package IronPrint
または、公式の IronPrint NuGet Web サイトから直接ダウンロードすることもできます。
インストールが完了したら、C# コードの先頭にusing IronPrint;を追加して開始できます。
ライセンスキーの適用
次に、ライセンス キーをLicenseクラスのLicenseKeyプロパティに割り当てて、有効なライセンス キーまたは試用キーを IronPrint に適用します。 IronPrint メソッドを使用する前に、import ステートメントの直後に次のコードを含めます。
using IronPrint;
// Apply your IronPrint license key here
License.LicenseKey = "your-license-key-here";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"コード例
文書を印刷
ドキュメントを印刷するには、ファイル パスをPrintメソッドに渡すだけです。
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 Classダイアログ付き印刷
ドキュメントを印刷するには、 ShowPrintDialogメソッドを使用します。このメソッドでは、印刷前に印刷ダイアログも表示されます。
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 Class印刷設定をカスタマイズする
コードから印刷設定を構成するには、 PrintSettingsクラスをインスタンス化します。 PrintSettingsオブジェクトを構成し、それを印刷メソッドの 1 つに渡します。
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);
}
}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);
}
}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ライセンスとサポートの提供
IronPrintは有料ライブラリですが、無料の試用ライセンスもこちらから入手できます。
Iron Software の詳細については、当社の Web サイトをご覧ください。https://ironsoftware.com/さらにサポートやお問い合わせが必要な場合は、当社のチームにお問い合わせください。
Iron Software からのサポート
一般的なサポートや技術的なお問い合わせについては、以下のメールアドレスまでご連絡ください。support@ironsoftware.com 。






