IRONSOFTWAREHOME
MIGRATION GUIDES

How to Migrate from RawPrint to IronPDF in C#

Curtis Chau
Curtis Chau
Updated: August 1, 2026

Moving from RawPrint to IronPDF is less a replacement than a refit: RawPrint and IronPDF solve different problems, and the honest framing for most teams is "complement," not "replace." This guide walks the cases where IronPDF genuinely subsumes a RawPrint pipeline (create-a-PDF-then-push-it workflows on Windows) and flags the cases where you should keep RawPrint in place (ESC/POS, ZPL, EPL, raw PCL).

Why Migrate from RawPrint to IronPDF

Understanding RawPrint

RawPrint is the NuGet package RawPrint (frogmorecs/RawPrint, v0.5.0, last released September 2019, now unlisted/legacy on nuget.org). It is a thin P/Invoke wrapper over winspool.Drv that ships a byte stream straight to the Windows print spooler with the RAW datatype. The public API is small: a Printer class implementing IPrinter in the RawPrint namespace, exposing PrintRawFile and PrintRawStream overloads. The underlying Win32 calls (OpenPrinter, StartDocPrinter, WritePrinter, EndDocPrinter, ClosePrinter) are hidden behind that interface - you do not write them yourself when using the package.

That makes RawPrint a good fit for ESC/POS receipt printers, ZPL/EPL Zebra label printers, and legacy PCL/PostScript jobs where you have already produced the bytes the printer firmware expects. For developers targeting Windows-specific environments and requiring direct printer communication, RawPrint offers an efficient pathway bypassing intermediary layers like drivers or graphical interfaces.

However, RawPrint is not a PDF library - it just pushes data to printers. If your application currently builds a PDF in some other library and then hands it to RawPrint, that whole pipeline can usually collapse into IronPDF on Windows.

The Core Problem: No PDF Creation

RawPrint has notable limitations that make it unsuitable for modern document workflows:

  1. No PDF Creation: RawPrint focuses solely on data transmission, lacking functionality for PDF creation, rendering, or manipulation.
  2. Very Low-Level: By dealing directly with raw bytes, developers must have a deep understanding of the printer's command language, making it less suitable for straightforward document printing tasks.
  3. Platform-Specific: It depends on Windows print spoolers, limiting its cross-platform applicability.
  4. No Document Processing: Just byte transmission with no rendering capabilities.
  5. Limited Control: Minimal print job configuration options.

RawPrint vs IronPDF Comparison

FeatureRawPrintIronPDF
FunctionalitySends raw print data directly to the printerComprehensive PDF creation and manipulation
Use CaseSpecialized printing like labelsGeneral document management and creation
Platform DependencyWindows-specificCross-platform
ComplexityLow-level, requires printer command knowledgeHigh-level, user-friendly API
PDF CreationNoYes
Create PDF from HTMLNoYes
Create PDF from URLNoYes
Edit/Modify PDFsNoYes
Merge/Split PDFsNoYes
Print Existing PDFYes (raw bytes)Yes (high-level API)
Print ControlBasicFull options
Ideal ForDirect printer access needsPDF-related tasks in web and desktop apps
FlexibilityLimited due to raw byte handlingExtensive with multiple functionalities

In stark contrast to RawPrint, IronPDF offers a robust and versatile API for handling PDFs comprehensively. As an established name in the .NET environment, IronPDF enables developers to create, edit, and convert PDFs effortlessly across platforms.

For teams targeting modern .NET, IronPDF provides cross-platform compatibility that RawPrint, by design, does not.


Before You Start

Prerequisites

  1. .NET Environment: .NET Framework 4.6.2+ or .NET Core 3.1+ / .NET 5/6/7/8/9+
  2. NuGet Access: Ability to install NuGet packages
  3. IronPDF License: Obtain your license key from ironpdf.com

NuGet Package Changes

# Remove RawPrint
dotnet remove package RawPrint

# Install IronPDF
dotnet add package IronPdf
SHELL

License Configuration

// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";

Find RawPrint Usage

# Identify all RawPrint usage
grep -r "using RawPrint" --include="*.cs" .
grep -r "PrintRawFile\|PrintRawStream" --include="*.cs" .
SHELL

Note: hand-rolled P/Invoke wrappers around winspool.Drv sometimes use the class name RawPrinterHelper and look superficially similar to RawPrint usage, but they are not the package - they call the Win32 spooler directly. The package itself only exposes IPrinter with PrintRawFile and PrintRawStream.


Complete API Reference

Namespace Changes

// Before: RawPrint
using RawPrint;

// After: IronPDF
using IronPdf;

Core API Mappings

RawPrint (real public API)IronPDFNotes
new Printer() / IPrinternew ChromePdfRenderer() / PdfDocumentRawPrint pushes bytes; IronPDF generates PDFs
printer.PrintRawFile(name, path, paused)PdfDocument.FromFile(path).Print()IronPDF re-renders to the OS print system; not RAW
printer.PrintRawStream(name, stream, doc, paused)new PdfDocument(stream).Print()Same caveat
printer.OnJobCreated eventn/aUse IronPDF print options instead
n/aChromePdfRenderer.RenderHtmlAsPdf()Create PDFs
n/aPdfDocument.Merge()Merge PDFs
n/apdf.ApplyWatermark()Add watermarks

IronPDF prints by handing the document to the operating system, not by streaming raw bytes to the spooler. If your printer requires the RAW datatype (ESC/POS, ZPL, certain PCL workflows), that is RawPrint's lane and IronPDF cannot stand in for it.


Code Migration Examples

Example 1: HTML to PDF Conversion

Before (RawPrint):

// NuGet: Install-Package RawPrint
using System;
using System.IO;
using System.Text;
using RawPrint;

class Program
{
    static void Main()
    {
        // RawPrint cannot convert HTML to PDF. Sending raw HTML bytes to a printer just
        // prints the HTML source as text — the markup is not rendered.
        string html = "<html><body><h1>Hello World</h1></body></html>";
        byte[] data = Encoding.ASCII.GetBytes(html);

        IPrinter printer = new Printer();
        using (var stream = new MemoryStream(data))
        {
            // PrintRawStream(printerName, stream, documentName, paused)
            printer.PrintRawStream("Microsoft Print to PDF", stream, "HTML Document", false);
        }
        Console.WriteLine("Raw HTML bytes sent to spooler (not rendered).");
    }
}

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");
    }
}

The architectural mismatch is visible even with the package's own friendly API: RawPrint ships bytes to a Windows spooler with the RAW datatype, so handing it HTML just causes the printer to print the source text. IronPDF's ChromePdfRenderer actually renders the markup. See the HTML to PDF documentation for comprehensive examples.

Example 2: URL to PDF Conversion

Before (RawPrint):

// NuGet: Install-Package RawPrint
using System;
using System.IO;
using System.Net.Http;
using System.Text;
using RawPrint;

class Program
{
    static void Main()
    {
        // RawPrint cannot fetch a URL or render a web page; downloading the HTML and
        // shipping it to the spooler just prints the raw HTML source.
        using (var client = new HttpClient())
        {
            string htmlSource = client.GetStringAsync("https://example.com").GetAwaiter().GetResult();
            byte[] data = Encoding.UTF8.GetBytes(htmlSource);

            IPrinter printer = new Printer();
            using (var stream = new MemoryStream(data))
            {
                printer.PrintRawStream("Microsoft Print to PDF", stream, "Web Page", false);
            }
            Console.WriteLine("Raw HTML sent to spooler (not a rendered PDF).");
        }
    }
}

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();
        // Render a live website directly to PDF with full CSS, JavaScript, and images
        var pdf = renderer.RenderUrlAsPdf("https://example.com");
        pdf.SaveAs("webpage.pdf");
        Console.WriteLine("Website rendered to PDF successfully");
    }
}

RawPrint cannot render web pages - it only ships bytes to the spooler. Downloading HTML and pushing it through results in the printer printing the source text, not rendered content. IronPDF's RenderUrlAsPdf() captures the fully rendered webpage with CSS, JavaScript, and images. Learn more in our tutorials.

Example 3: Document Formatting

Before (RawPrint):

// NuGet: Install-Package RawPrint
using System;
using System.IO;
using System.Text;
using RawPrint;

class Program
{
    static void Main()
    {
        // RawPrint has no concept of fonts, margins, or layout — formatting must be
        // expressed in the printer's own command language (PCL, PostScript, ESC/POS, ZPL).
        // Example: a tiny PCL5 stream that selects portrait and a 16.66cpi font.
        string pclCommands = "\x1B&l0O\x1B(s0p16.66h8.5v0s0b3T";
        string text = "Plain text document - formatting must be expressed in printer command language";
        byte[] data = Encoding.ASCII.GetBytes(pclCommands + text);

        IPrinter printer = new Printer();
        using (var stream = new MemoryStream(data))
        {
            printer.PrintRawStream("HP LaserJet", stream, "Raw Document", false);
        }
    }
}

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>
            <head>
                <style>
                    body { font-family: Arial; margin: 40px; }
                    h1 { color: #2c3e50; font-size: 24px; }
                    p { line-height: 1.6; color: #34495e; }
                    .highlight { background-color: yellow; font-weight: bold; }
                </style>
            </head>
            <body>
                <h1>Formatted Document</h1>
                <p>This is a <span class='highlight'>beautifully formatted</span> document with CSS styling.</p>
                <p>Complex layouts, fonts, colors, and images are fully supported.</p>
            </body>
            </html>";
        
        var pdf = renderer.RenderHtmlAsPdf(html);
        pdf.SaveAs("formatted.pdf");
        Console.WriteLine("Formatted PDF created successfully");
    }
}
C#

With RawPrint, formatting beyond plain bytes means hand-authoring printer command sequences like "\x1B&l0O\x1B(s0p16.66h8.5v0s0b3T" and knowing the target printer's PCL or PostScript dialect. IronPDF uses standard HTML and CSS - complex layouts, fonts, colors, and images are fully supported without printer-specific knowledge.


Feature Comparison Summary

FeatureRawPrintIronPDF
PDF Creation
HTML to PDFNoYes
URL to PDFNoYes
Create from scratchNoYes
PDF Manipulation
Merge PDFsNoYes
Split PDFsNoYes
Add WatermarksNoYes
Edit ExistingNoYes
Printing
Push RAW bytes to spoolerYesNo
ESC/POS, ZPL, raw PCLYesNo
Print via OS print systemNoYes
Platform
WindowsYesYes
LinuxNoYes
macOSNoYes
DockerNoYes
Other
Encryption / SecurityNoYes
Digital SignaturesNoYes
PDF/ANoYes

New Capabilities After Migration

After migrating to IronPDF, you gain capabilities that RawPrint cannot provide:

PDF Merging

var pdfs = pdfFiles.Select(f => PdfDocument.FromFile(f)).ToList();
var merged = PdfDocument.Merge(pdfs);
merged.SaveAs("complete.pdf");
var pdf = PdfDocument.FromFile("report.pdf");

pdf.Print(new PrintOptions
{
    PrinterName = "HP LaserJet",
    NumberOfCopies = 2,
    DPI = 300,
    GrayScale = false
});

Create and Print in One Workflow

var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(@"
    <h1>Invoice #12345</h1>
    <p>Customer: John Doe</p>
    <p>Amount: $150.00</p>
");

// Print directly
pdf.Print("HP LaserJet");

// Or save first
pdf.SaveAs("invoice.pdf");

Migration Checklist

Pre-Migration

  • Identify all RawPrint usage (PrintRawFile, PrintRawStream)
  • Classify each call site: PDFs going to office printers are candidates for IronPDF; ESC/POS, ZPL, EPL, or hand-built PCL/PostScript bytes should stay on RawPrint
  • Document printer names used in your application - IronPDF prints through the OS print system, so the names must still resolve
  • Note any external PDF creation code that can be consolidated
  • Obtain IronPDF license key from ironpdf.com

Code Updates

  • Install IronPDF package: dotnet add package IronPdf
  • Only remove RawPrint where there are no remaining raw-byte channels: dotnet remove package RawPrint
  • Replace create-then-RawPrint pipelines with ChromePdfRenderer plus pdf.Print()
  • Consolidate PDF creation and printing into a single workflow on Windows
  • Add license initialization at application startup

Testing

  • Test printing to target printers
  • Verify print quality
  • Test multiple copies
  • Test silent printing
  • Cross-platform verification if needed

Please note: RawPrint is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by RawPrint. All product names, logos, and brands are property of their respective owners. Comparisons are for informational purposes only and reflect publicly available information at the time of writing.
Curtis Chau
Technical Writer

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.

...
Read More

Related Articles

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required