How to Migrate from PDFPrinting.NET to IronPDF in C#
Migrating from PDFPrinting.NET to IronPDF expands your PDF capabilities from a printing-only library to a comprehensive solution that handles the complete PDF lifecycle including creation, manipulation, extraction, security, and printing. This guide provides a complete, step-by-step migration path that preserves your existing printing workflows while adding PDF generation, HTML conversion, and cross-platform support capabilities.
Why Migrate from PDFPrinting.NET to IronPDF
Understanding PDFPrinting.NET
PDFPrinting.NET (Terminalworks; NuGet PdfPrintingNet) is a specialized library focused on silent PDF printing within Windows environments. As a dedicated tool focused on the silent printing of existing PDFs, it simplifies the task of dispatching documents to a printer programmatically without user intervention. The newer entry point is the PdfPrint class; older code may still reference the legacy TerminalWorks.PDFPrinting.PDFPrinter.
A core strength is silent printing — bypassing the usual print dialogue windows so fully automated workflows can run unattended.
The Printing-Centric Limitation
PDFPrinting.NET concentrates on a narrow set of operations and does not author new PDF content. Its scope is print, view, basic edit, and rasterize existing documents:
-
Print-centric: Authors no new PDF content — only prints, views, edits, and rasterizes pre-existing PDFs.
-
Windows-only printing: Tied to the Windows printing infrastructure, which limits cross-platform usability.
-
No HTML/URL-to-PDF API: There is no
HtmlToPdfConverterand noWebPageToPdfConverterclass — these features do not exist in the API surface. -
Limited manipulation: Basic merge/split/extract is available via
PdfPrintDocument; there is no watermarking or modern content authoring. -
No comprehensive text extraction surface.
- No form filling or flattening.
PDFPrinting.NET vs IronPDF Comparison
| Feature | PDFPrinting.NET | IronPDF |
|---|---|---|
| Primary Functionality | Silent PDF printing | Full cycle handling (create, edit, print) |
| Platform Support | Windows only | Cross-platform |
| PDF Creation/Manipulation Capability | No | Yes |
| HTML-to-PDF Conversion | No | Yes |
| Suitability for Automated Workflows | High | High |
| Additional Dependencies | Relies on Windows printers | Internal browser engine for rendering |
| Silent Printing | Yes | Yes |
| Text Extraction | Not supported | Supported |
| Licensing | Commercial | Commercial |
IronPDF presents a more comprehensive solution by addressing the complete lifecycle of PDF handling. It facilitates the creation, editing, conversion, and printing of PDF documents, offering developers a full suite of features through a unified API. Unlike PDFPrinting.NET, IronPDF can be deployed across different platforms, making it a versatile choice for applications that operate in diverse environments.
For teams on modern .NET, IronPDF provides a complete PDF solution that works across Windows, Linux, and macOS environments.
Before You Start
Prerequisites
- .NET Environment: .NET Framework 4.6.2+ or .NET Core 3.1+ / .NET 5/6/7/8/9+
- NuGet Access: Ability to install NuGet packages
- IronPDF License: Obtain your license key from ironpdf.com
NuGet Package Changes
# Remove PDFPrinting.NET (the actual NuGet ID is PdfPrintingNet)
dotnet remove package PdfPrintingNet
# Install IronPDF
dotnet add package IronPdf
# Remove PDFPrinting.NET (the actual NuGet ID is PdfPrintingNet)
dotnet remove package PdfPrintingNet
# Install IronPDF
dotnet add package IronPdf
License Configuration
// Add at application startup (Program.cs or Startup.cs)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Add at application startup (Program.cs or Startup.cs)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
' Add at application startup (Program.vb or Startup.vb)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
Identify PDFPrinting.NET Usage
# Find PDFPrinting.NET usage (newer + legacy namespaces)
grep -rE "PdfPrintingNet|TerminalWorks\.PDFPrinting|PdfPrint\b|PdfPrintDocument|PDFPrinter" --include="*.cs" .
# Find print-related code
grep -r "\.Print(\|PrinterName\|GetPrintDocument" --include="*.cs" .
# Find PDFPrinting.NET usage (newer + legacy namespaces)
grep -rE "PdfPrintingNet|TerminalWorks\.PDFPrinting|PdfPrint\b|PdfPrintDocument|PDFPrinter" --include="*.cs" .
# Find print-related code
grep -r "\.Print(\|PrinterName\|GetPrintDocument" --include="*.cs" .
Complete API Reference
Namespace Changes
// Before: PDFPrinting.NET
// Newer API:
using PdfPrintingNet;
// Older code may use:
using TerminalWorks.PDFPrinting;
// After: IronPDF
using IronPdf;
using IronPdf.Rendering;
using IronPdf.Printing;
// Before: PDFPrinting.NET
// Newer API:
using PdfPrintingNet;
// Older code may use:
using TerminalWorks.PDFPrinting;
// After: IronPDF
using IronPdf;
using IronPdf.Rendering;
using IronPdf.Printing;
' Before: PDFPrinting.NET
' Newer API:
Imports PdfPrintingNet
' Older code may use:
Imports TerminalWorks.PDFPrinting
' After: IronPDF
Imports IronPdf
Imports IronPdf.Rendering
Imports IronPdf.Printing
Core Class Mappings
| PDFPrinting.NET | IronPDF |
|---|---|
PdfPrint (newer) / PDFPrinter (legacy) |
PdfDocument + Print() |
PdfPrintDocument |
PdfDocument |
| (no HTML-to-PDF class exists) | ChromePdfRenderer.RenderHtmlAsPdf |
| (no URL-to-PDF class exists) | ChromePdfRenderer.RenderUrlAsPdf |
| Print settings properties | PrintSettings |
Printing Method Mappings
| PDFPrinting.NET | IronPDF |
|---|---|
pdfPrint.Print(filePath) |
pdf.Print() |
pdfPrint.PrinterName = "..."; pdfPrint.Print(path) |
pdf.Print(printerName) |
new PdfPrintDocument(...) |
pdf.GetPrintDocument() |
pdfPrint.Copies = n |
printSettings.NumberOfCopies = n |
pdfPrint.Duplex = true |
printSettings.DuplexMode = Duplex.Vertical |
pdfPrint.Collate = true |
printSettings.Collate = true |
New Features Not Available in PDFPrinting.NET
| IronPDF Feature | Description |
|---|---|
renderer.RenderHtmlAsPdf(html) |
HTML to PDF conversion |
renderer.RenderUrlAsPdf(url) |
URL to PDF conversion |
PdfDocument.Merge(pdfs) |
Merge multiple PDFs |
pdf.ApplyWatermark(html) |
Add watermarks |
pdf.SecuritySettings.UserPassword |
Password protection |
pdf.ExtractAllText() |
Text extraction |
Code Migration Examples
Example 1: HTML to PDF Conversion
Before (PDFPrinting.NET): PDFPrinting.NET has no HTML-to-PDF API — there is no HtmlToPdfConverter class. The closest workflow is to generate the PDF with another library and then print or hand off the file:
// NuGet: Install-Package PdfPrintingNet
using PdfPrintingNet;
using System;
class Program
{
static void Main()
{
// Step 1: Produce the PDF with another library (PDFPrinting.NET cannot).
// Step 2: Print the existing PDF file.
var pdfPrint = new PdfPrint("license-owner", "license-key");
var status = pdfPrint.Print("output.pdf");
Console.WriteLine($"Printed: {status}");
}
}
// NuGet: Install-Package PdfPrintingNet
using PdfPrintingNet;
using System;
class Program
{
static void Main()
{
// Step 1: Produce the PDF with another library (PDFPrinting.NET cannot).
// Step 2: Print the existing PDF file.
var pdfPrint = new PdfPrint("license-owner", "license-key");
var status = pdfPrint.Print("output.pdf");
Console.WriteLine($"Printed: {status}");
}
}
Imports PdfPrintingNet
Imports System
Class Program
Shared Sub Main()
' Step 1: Produce the PDF with another library (PDFPrinting.NET cannot).
' Step 2: Print the existing PDF file.
Dim pdfPrint = New PdfPrint("license-owner", "license-key")
Dim status = pdfPrint.Print("output.pdf")
Console.WriteLine($"Printed: {status}")
End Sub
End Class
After (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
Console.WriteLine("PDF created successfully");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
Console.WriteLine("PDF created successfully");
}
}
Imports IronPdf
Imports System
Class Program
Shared Sub Main()
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim renderer As New ChromePdfRenderer()
Dim html As String = "<html><body><h1>Hello World</h1></body></html>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs("output.pdf")
Console.WriteLine("PDF created successfully")
End Sub
End Class
Because PDFPrinting.NET cannot author PDFs at all, the migration is not a one-for-one class swap — it's adopting a new capability. IronPDF's ChromePdfRenderer.RenderHtmlAsPdf() returns a PdfDocument you can manipulate (watermarks, merging, security) before saving with SaveAs(). By leveraging a Chromium-based engine, IronPDF replicates modern CSS and JavaScript rendering with high fidelity. See the HTML to PDF documentation for comprehensive examples.
Example 2: URL to PDF Conversion
Before (PDFPrinting.NET): There is no WebPageToPdfConverter class — PDFPrinting.NET does not download or render web pages. A separate library must capture the URL as PDF first; PDFPrinting.NET can then print the resulting file:
// NuGet: Install-Package PdfPrintingNet
using PdfPrintingNet;
using System;
class Program
{
static void Main()
{
// Step 1: Capture the URL with another library (PDFPrinting.NET cannot).
// Step 2: Print the resulting PDF.
var pdfPrint = new PdfPrint("license-owner", "license-key");
var status = pdfPrint.Print("webpage.pdf");
Console.WriteLine($"Printed: {status}");
}
}
// NuGet: Install-Package PdfPrintingNet
using PdfPrintingNet;
using System;
class Program
{
static void Main()
{
// Step 1: Capture the URL with another library (PDFPrinting.NET cannot).
// Step 2: Print the resulting PDF.
var pdfPrint = new PdfPrint("license-owner", "license-key");
var status = pdfPrint.Print("webpage.pdf");
Console.WriteLine($"Printed: {status}");
}
}
Imports PdfPrintingNet
Imports System
Class Program
Shared Sub Main()
' Step 1: Capture the URL with another library (PDFPrinting.NET cannot).
' Step 2: Print the resulting PDF.
Dim pdfPrint As New PdfPrint("license-owner", "license-key")
Dim status = pdfPrint.Print("webpage.pdf")
Console.WriteLine($"Printed: {status}")
End Sub
End Class
After (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
string url = "https://www.example.com";
var pdf = renderer.RenderUrlAsPdf(url);
pdf.SaveAs("webpage.pdf");
Console.WriteLine("PDF from URL created successfully");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
string url = "https://www.example.com";
var pdf = renderer.RenderUrlAsPdf(url);
pdf.SaveAs("webpage.pdf");
Console.WriteLine("PDF from URL created successfully");
}
}
Imports IronPdf
Imports System
Module Program
Sub Main()
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim renderer As New ChromePdfRenderer()
Dim url As String = "https://www.example.com"
Dim pdf = renderer.RenderUrlAsPdf(url)
pdf.SaveAs("webpage.pdf")
Console.WriteLine("PDF from URL created successfully")
End Sub
End Module
IronPDF uses a single ChromePdfRenderer class for both HTML strings and URLs, with RenderUrlAsPdf() handling the web capture in one call. Learn more in our tutorials.
Example 3: Headers and Footers
Before (PDFPrinting.NET): PDFPrinting.NET cannot author headers or footers — it does not generate PDFs from HTML or any other source, and offers no header/footer composition API. If your PDF already contains them, the library can print it:
// NuGet: Install-Package PdfPrintingNet
using PdfPrintingNet;
using System;
class Program
{
static void Main()
{
// Headers/footers must already be baked into the PDF.
var pdfPrint = new PdfPrint("license-owner", "license-key");
pdfPrint.Print("report.pdf");
Console.WriteLine("PDF with pre-existing headers/footers printed");
}
}
// NuGet: Install-Package PdfPrintingNet
using PdfPrintingNet;
using System;
class Program
{
static void Main()
{
// Headers/footers must already be baked into the PDF.
var pdfPrint = new PdfPrint("license-owner", "license-key");
pdfPrint.Print("report.pdf");
Console.WriteLine("PDF with pre-existing headers/footers printed");
}
}
Imports PdfPrintingNet
Imports System
Module Program
Sub Main()
' Headers/footers must already be baked into the PDF.
Dim pdfPrint As New PdfPrint("license-owner", "license-key")
pdfPrint.Print("report.pdf")
Console.WriteLine("PDF with pre-existing headers/footers printed")
End Sub
End Module
After (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center'>Company Report</div>"
};
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center'>Page {page} of {total-pages}</div>"
};
string html = "<html><body><h1>Document Content</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("report.pdf");
Console.WriteLine("PDF with headers/footers created");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center'>Company Report</div>"
};
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center'>Page {page} of {total-pages}</div>"
};
string html = "<html><body><h1>Document Content</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("report.pdf");
Console.WriteLine("PDF with headers/footers created");
}
}
Imports IronPdf
Imports IronPdf.Rendering
Imports System
Module Program
Sub Main()
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim renderer As New ChromePdfRenderer()
renderer.RenderingOptions.HtmlHeader = New HtmlHeaderFooter() With {
.HtmlFragment = "<div style='text-align:center'>Company Report</div>"
}
renderer.RenderingOptions.HtmlFooter = New HtmlHeaderFooter() With {
.HtmlFragment = "<div style='text-align:center'>Page {page} of {total-pages}</div>"
}
Dim html As String = "<html><body><h1>Document Content</h1></body></html>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs("report.pdf")
Console.WriteLine("PDF with headers/footers created")
End Sub
End Module
IronPDF uses HtmlHeaderFooter objects with an HtmlFragment property that accepts full HTML, allowing rich styling with CSS. Placeholders such as {page} and {total-pages} are substituted at render time.
Critical Migration Notes
Header/Footer Placeholders Are an IronPDF-Only Feature
PDFPrinting.NET has no header or footer authoring API at all, so there is no placeholder syntax to migrate from. IronPDF supports {page} and {total-pages} placeholders inside HtmlHeaderFooter.HtmlFragment:
// IronPDF placeholders
"Page {page} of {total-pages}"
// IronPDF placeholders
"Page {page} of {total-pages}"
"Page {page} of {total-pages}"
Load-Then-Print Pattern
PDFPrinting.NET passes file paths directly to Print(); IronPDF loads the document first:
// PDFPrinting.NET: Direct path to Print()
pdfPrint.Print("document.pdf");
// IronPDF: Load first, then operate
var pdf = PdfDocument.FromFile("document.pdf");
pdf.Print();
// PDFPrinting.NET: Direct path to Print()
pdfPrint.Print("document.pdf");
// IronPDF: Load first, then operate
var pdf = PdfDocument.FromFile("document.pdf");
pdf.Print();
' PDFPrinting.NET: Direct path to Print()
pdfPrint.Print("document.pdf")
' IronPDF: Load first, then operate
Dim pdf = PdfDocument.FromFile("document.pdf")
pdf.Print()
Print Settings Migration
PDFPrinting.NET uses properties on PdfPrint; IronPDF uses a settings object:
// PDFPrinting.NET: Properties on PdfPrint
pdfPrint.Copies = 2;
pdfPrint.Duplex = true;
// IronPDF: Settings object
var settings = new PrintSettings
{
NumberOfCopies = 2,
DuplexMode = System.Drawing.Printing.Duplex.Vertical
};
pdf.Print(settings);
// PDFPrinting.NET: Properties on PdfPrint
pdfPrint.Copies = 2;
pdfPrint.Duplex = true;
// IronPDF: Settings object
var settings = new PrintSettings
{
NumberOfCopies = 2,
DuplexMode = System.Drawing.Printing.Duplex.Vertical
};
pdf.Print(settings);
' PDFPrinting.NET: Properties on PdfPrint
pdfPrint.Copies = 2
pdfPrint.Duplex = True
' IronPDF: Settings object
Dim settings As New PrintSettings With {
.NumberOfCopies = 2,
.DuplexMode = System.Drawing.Printing.Duplex.Vertical
}
pdf.Print(settings)
New Capabilities After Migration
After migrating to IronPDF, you gain capabilities that PDFPrinting.NET cannot provide:
PDF Merging
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
Dim pdf1 = PdfDocument.FromFile("document1.pdf")
Dim pdf2 = PdfDocument.FromFile("document2.pdf")
Dim merged = PdfDocument.Merge(pdf1, pdf2)
merged.SaveAs("merged.pdf")
Watermarks
pdf.ApplyWatermark("<h2 style='color:red;'>CONFIDENTIAL</h2>");
pdf.ApplyWatermark("<h2 style='color:red;'>CONFIDENTIAL</h2>");
pdf.ApplyWatermark("<h2 style='color:red;'>CONFIDENTIAL</h2>")
Password Protection
pdf.SecuritySettings.UserPassword = "userpassword";
pdf.SecuritySettings.OwnerPassword = "ownerpassword";
pdf.SecuritySettings.UserPassword = "userpassword";
pdf.SecuritySettings.OwnerPassword = "ownerpassword";
pdf.SecuritySettings.UserPassword = "userpassword"
pdf.SecuritySettings.OwnerPassword = "ownerpassword"
Text Extraction
string text = pdf.ExtractAllText();
string text = pdf.ExtractAllText();
Dim text As String = pdf.ExtractAllText()
Generate-Then-Print Workflow
With IronPDF, you can generate PDFs and print them in one workflow:
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Invoice</h1>");
pdf.Print("Invoice Printer");
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Invoice</h1>");
pdf.Print("Invoice Printer");
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Invoice</h1>")
pdf.Print("Invoice Printer")
Cross-Platform Printing
PDFPrinting.NET is Windows-only. IronPDF works cross-platform:
Windows
pdf.Print("HP LaserJet");
pdf.Print("HP LaserJet");
pdf.Print("HP LaserJet")
Linux
// Requires CUPS (Common Unix Printing System)
// Install: apt-get install cups
pdf.Print("HP_LaserJet"); // CUPS uses underscores instead of spaces
// Requires CUPS (Common Unix Printing System)
// Install: apt-get install cups
pdf.Print("HP_LaserJet"); // CUPS uses underscores instead of spaces
macOS
pdf.Print("HP LaserJet");
pdf.Print("HP LaserJet");
pdf.Print("HP LaserJet")
Feature Comparison Summary
| Feature | PDFPrinting.NET | IronPDF |
|---|---|---|
| Silent Printing | ✓ | ✓ |
| Print Settings | ✓ | ✓ |
| HTML to PDF | ✗ | ✓ |
| URL to PDF | ✗ | ✓ |
| Headers/Footers | Basic | Full HTML |
| Merge PDFs | ✗ | ✓ |
| Split PDFs | ✗ | ✓ |
| Watermarks | ✗ | ✓ |
| Text Extraction | ✗ | ✓ |
| Password Protection | ✗ | ✓ |
| Cross-Platform | ✗ | ✓ |
Migration Checklist
Pre-Migration
- Inventory all PDFPrinting.NET usage in codebase
- Document all printer names currently used
- Note all print settings configurations
- Identify if cross-platform support is needed
- Plan IronPDF license key storage (environment variables recommended)
- Test with IronPDF trial license first
Package Changes
- Remove
PdfPrintingNetNuGet package - Install
IronPdfNuGet package:dotnet add package IronPdf
Code Changes
- Update namespace imports (
PdfPrintingNet/ legacyTerminalWorks.PDFPrinting→IronPdf) - Convert
pdfPrint.Print(path)calls to thePdfDocument.FromFile(path).Print()pattern - Move per-print properties (
Copies,Duplex,Collate,PrinterName) onto aPrintSettingsobject - Adopt new capabilities: use
ChromePdfRenderer.RenderHtmlAsPdf/RenderUrlAsPdffor HTML and URL inputs (no equivalent existed in PDFPrinting.NET) - Configure headers/footers via
RenderingOptions.HtmlHeaderandHtmlFooter(new capability) - Set
IronPdf.License.LicenseKeyat application startup
Post-Migration
- Test printing on all target platforms
- Verify header/footer rendering
- Consider adding PDF generation for dynamic documents
- Add new capabilities (merging, watermarks, security) as needed

