Skip to footer content
MIGRATION GUIDES

How to Migrate from Scryber.Core to IronPDF in C#

Migrating from Scryber.Core to IronPDF transforms your PDF generation workflow from a custom XML/HTML parsing engine to a modern Chromium-powered renderer with full CSS3 and JavaScript support. This guide provides a complete, step-by-step migration path that eliminates LGPL licensing concerns, proprietary template syntax, and limited rendering capabilities.

Why Migrate from Scryber.Core to IronPDF

Understanding Scryber.Core

Scryber.Core is an open-source library that transforms HTML templates into PDFs using C#. This capability makes it an attractive tool for developers familiar with web development and HTML. Unlike other PDF solutions that require specific document coding skills, Scryber.Core leverages HTML's versatility and CSS styling capabilities to provide a more intuitive PDF generation approach.

Although Scryber.Core is a viable option for many developers, primarily due to its ideological alignment with open-source principles and the flexibility it offers, it is not without limitations.

Key Reasons to Migrate

  1. LGPL License Concerns: The LGPL license demands that any modifications to the library itself are open-sourced, which can be limiting for some commercial applications
  2. Custom Template Syntax: Proprietary binding syntax requires learning curve
  3. Limited CSS Support: Not a full browser-based renderer
  4. Smaller Community: Less documentation and community examples
  5. No JavaScript Execution: Static rendering only
  6. Complex Configuration: XML-heavy configuration approach
  7. Limited Commercial Support: Scryber.Core is primarily community-supported

Scryber.Core vs IronPDF Comparison

AspectScryber.CoreIronPDF
LicenseLGPL (restrictive)Commercial
Rendering EngineCustomChromium
CSS SupportLimitedFull CSS3
JavaScriptNoFull ES2024
Template BindingProprietary XMLStandard (Razor, etc.)
Learning CurveCustom syntaxStandard HTML/CSS
Async SupportLimitedFull
DocumentationBasicExtensive
Community SupportSmallerLarge
Commercial SupportLimitedProfessional support included

IronPDF offers enterprise-grade commercial support, extensive documentation, and a larger community compared to Scryber.Core. The library provides more flexible licensing options without LGPL restrictions, making it ideal for commercial applications.

For teams planning .NET 10 and C# 14 adoption through 2025 and 2026, IronPDF's modern Chromium engine provides full compatibility with contemporary web standards.


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 Scryber.Core
dotnet remove package Scryber.Core

# Install IronPDF
dotnet add package IronPdf
# Remove Scryber.Core
dotnet remove package Scryber.Core

# Install IronPDF
dotnet add package IronPdf
SHELL

License Configuration

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

Complete API Reference

Namespace Changes

// Before: Scryber.Core
using Scryber.Components;
using Scryber.Components.Pdf;
using Scryber.PDF;
using Scryber.Styles;
using Scryber.Core;
using Scryber.Core.Html;
using Scryber.Drawing;

// After: IronPDF
using IronPdf;
using IronPdf.Rendering;
// Before: Scryber.Core
using Scryber.Components;
using Scryber.Components.Pdf;
using Scryber.PDF;
using Scryber.Styles;
using Scryber.Core;
using Scryber.Core.Html;
using Scryber.Drawing;

// After: IronPDF
using IronPdf;
using IronPdf.Rendering;
$vbLabelText   $csharpLabel

Core API Mappings

Scryber.CoreIronPDFNotes
Document.ParseDocument(html)renderer.RenderHtmlAsPdf(html)HTML rendering
Document.ParseTemplate(path)renderer.RenderHtmlFileAsPdf(path)File rendering
doc.SaveAsPDF(path)pdf.SaveAs(path)Save to file
doc.SaveAsPDF(stream)pdf.Stream or pdf.BinaryDataGet stream/bytes
doc.Info.Titlepdf.MetaData.TitleMetadata
doc.Info.Authorpdf.MetaData.AuthorMetadata
PDFPagepdf.Pages[i]Page access
PDFLayoutDocumentRenderingOptionsLayout control
PDFStyleCSS in HTMLStyling
doc.RenderOptions.PaperSizeRenderingOptions.PaperSizePaper size
Data binding ({{value}})Razor/String interpolationTemplating

Code Migration Examples

Example 1: Basic HTML to PDF Conversion

Before (Scryber.Core):

// NuGet: Install-Package Scryber.Core
using Scryber.Core;
using Scryber.Core.Html;
using System.IO;

class Program
{
    static void Main()
    {
        string html = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>";

        using (var doc = Document.ParseDocument(html, ParseSourceType.DynamicContent))
        {
            doc.SaveAsPDF("output.pdf");
        }
    }
}
// NuGet: Install-Package Scryber.Core
using Scryber.Core;
using Scryber.Core.Html;
using System.IO;

class Program
{
    static void Main()
    {
        string html = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>";

        using (var doc = Document.ParseDocument(html, ParseSourceType.DynamicContent))
        {
            doc.SaveAsPDF("output.pdf");
        }
    }
}
$vbLabelText   $csharpLabel

After (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        string html = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>";

        var pdf = renderer.RenderHtmlAsPdf(html);
        pdf.SaveAs("output.pdf");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        string html = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>";

        var pdf = renderer.RenderHtmlAsPdf(html);
        pdf.SaveAs("output.pdf");
    }
}
$vbLabelText   $csharpLabel

This example demonstrates the fundamental architectural difference. Scryber.Core uses Document.ParseDocument() with a ParseSourceType.DynamicContent parameter to parse HTML content, requiring a using block for proper disposal. The document is then saved with SaveAsPDF().

IronPDF uses a ChromePdfRenderer instance with RenderHtmlAsPdf() to render HTML directly. The PDF is saved with SaveAs(). No manual disposal is required—IronPDF handles cleanup automatically. See the HTML to PDF documentation for comprehensive examples.

Example 2: URL to PDF Conversion

Before (Scryber.Core):

// NuGet: Install-Package Scryber.Core
using Scryber.Core;
using Scryber.Core.Html;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        string html = await client.GetStringAsync("https://www.example.com");

        using (var doc = Document.ParseDocument(html, ParseSourceType.DynamicContent))
        {
            doc.SaveAsPDF("webpage.pdf");
        }
    }
}
// NuGet: Install-Package Scryber.Core
using Scryber.Core;
using Scryber.Core.Html;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        string html = await client.GetStringAsync("https://www.example.com");

        using (var doc = Document.ParseDocument(html, ParseSourceType.DynamicContent))
        {
            doc.SaveAsPDF("webpage.pdf");
        }
    }
}
$vbLabelText   $csharpLabel

After (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderUrlAsPdf("https://www.example.com");
        pdf.SaveAs("webpage.pdf");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderUrlAsPdf("https://www.example.com");
        pdf.SaveAs("webpage.pdf");
    }
}
$vbLabelText   $csharpLabel

Scryber.Core cannot directly convert URLs to PDF. You must manually fetch the HTML content using HttpClient.GetStringAsync(), then parse the downloaded HTML with Document.ParseDocument(). This approach misses JavaScript execution, dynamic content, and proper CSS resolution because the custom parser doesn't execute scripts.

IronPDF's RenderUrlAsPdf() method handles the entire process in a single call, including full JavaScript execution and CSS rendering with its Chromium engine. Learn more in our tutorials.

Example 3: Custom Page Settings and Margins

Before (Scryber.Core):

// NuGet: Install-Package Scryber.Core
using Scryber.Core;
using Scryber.Core.Html;
using Scryber.Drawing;
using System.IO;

class Program
{
    static void Main()
    {
        string html = "<html><body><h1>Custom PDF</h1><p>With custom margins and settings.</p></body></html>";

        using (var doc = Document.ParseDocument(html, ParseSourceType.DynamicContent))
        {
            doc.RenderOptions.Compression = OutputCompressionType.FlateDecode;
            doc.RenderOptions.PaperSize = PaperSize.A4;
            doc.SaveAsPDF("custom.pdf");
        }
    }
}
// NuGet: Install-Package Scryber.Core
using Scryber.Core;
using Scryber.Core.Html;
using Scryber.Drawing;
using System.IO;

class Program
{
    static void Main()
    {
        string html = "<html><body><h1>Custom PDF</h1><p>With custom margins and settings.</p></body></html>";

        using (var doc = Document.ParseDocument(html, ParseSourceType.DynamicContent))
        {
            doc.RenderOptions.Compression = OutputCompressionType.FlateDecode;
            doc.RenderOptions.PaperSize = PaperSize.A4;
            doc.SaveAsPDF("custom.pdf");
        }
    }
}
$vbLabelText   $csharpLabel

After (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
        renderer.RenderingOptions.MarginTop = 40;
        renderer.RenderingOptions.MarginBottom = 40;

        string html = "<html><body><h1>Custom PDF</h1><p>With custom margins and settings.</p></body></html>";
        var pdf = renderer.RenderHtmlAsPdf(html);
        pdf.SaveAs("custom.pdf");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
        renderer.RenderingOptions.MarginTop = 40;
        renderer.RenderingOptions.MarginBottom = 40;

        string html = "<html><body><h1>Custom PDF</h1><p>With custom margins and settings.</p></body></html>";
        var pdf = renderer.RenderHtmlAsPdf(html);
        pdf.SaveAs("custom.pdf");
    }
}
$vbLabelText   $csharpLabel

Scryber.Core uses doc.RenderOptions to configure output settings like Compression (set to OutputCompressionType.FlateDecode) and PaperSize (set to PaperSize.A4) after parsing the document.

IronPDF uses RenderingOptions on the renderer before rendering. Properties include PaperSize (set to PdfPaperSize.A4), MarginTop, and MarginBottom set in millimeters. The key difference is that IronPDF provides direct margin control through numeric properties, while Scryber.Core uses XML-based styling.


Template Migration Patterns

Migrating Proprietary Binding to Standard Templates

Scryber.Core uses proprietary XML-based binding syntax that must be converted to standard templating:

Scryber.Core Binding:

<pdf:Para text='{{model.Name}}' />
<pdf:Para text='Total: {{model.Total:C}}' />
<pdf:ForEach on='{{model.Items}}'>
    <pdf:Para text='{{.Name}}: {{.Price}}' />
</pdf:ForEach>
<pdf:Para text='{{model.Name}}' />
<pdf:Para text='Total: {{model.Total:C}}' />
<pdf:ForEach on='{{model.Items}}'>
    <pdf:Para text='{{.Name}}: {{.Price}}' />
</pdf:ForEach>
XML

IronPDF with C# String Interpolation:

var items = model.Items.Select(i => $"<li>{i.Name}: {i.Price:C}</li>");

var html = $@"
<p>{model.Name}</p>
<p>Total: {model.Total:C}</p>
<ul>
    {string.Join("", items)}
</ul>";

var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
var items = model.Items.Select(i => $"<li>{i.Name}: {i.Price:C}</li>");

var html = $@"
<p>{model.Name}</p>
<p>Total: {model.Total:C}</p>
<ul>
    {string.Join("", items)}
</ul>";

var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
$vbLabelText   $csharpLabel

The key advantage: IronPDF uses standard C# and HTML, so you can use any templating engine (Razor, Handlebars, etc.) rather than learning proprietary syntax.


Headers and Footers Migration

Scryber.Core (XML-based header/footer):

<?xml version='1.0' encoding='utf-8' ?>
<pdf:Document xmlns:pdf='http://www.scryber.co.uk/schemas/core/release/v1/Scryber.Components.xsd'>
    <Pages>
        <pdf:Section>
            <Header>
                <pdf:Para text='Company Report' />
            </Header>
            <Footer>
                <pdf:Para text='Page {{pagenum}} of {{pagetotal}}' />
            </Footer>
            <Content>
                <pdf:H1 text='Content Here' />
            </Content>
        </pdf:Section>
    </Pages>
</pdf:Document>
<?xml version='1.0' encoding='utf-8' ?>
<pdf:Document xmlns:pdf='http://www.scryber.co.uk/schemas/core/release/v1/Scryber.Components.xsd'>
    <Pages>
        <pdf:Section>
            <Header>
                <pdf:Para text='Company Report' />
            </Header>
            <Footer>
                <pdf:Para text='Page {{pagenum}} of {{pagetotal}}' />
            </Footer>
            <Content>
                <pdf:H1 text='Content Here' />
            </Content>
        </pdf:Section>
    </Pages>
</pdf:Document>
XML

IronPDF (HTML headers/footers):

using IronPdf;

var renderer = new ChromePdfRenderer();

// HTML header with full CSS support
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter
{
    HtmlFragment = @"
        <div style='width: 100%; text-align: center; font-size: 12pt; border-bottom: 1px solid #ccc;'>
            Company Report
        </div>",
    MaxHeight = 30
};

// HTML footer with page numbers
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter
{
    HtmlFragment = @"
        <div style='width: 100%; text-align: center; font-size: 10pt;'>
            Page {page} of {total-pages}
        </div>",
    MaxHeight = 25
};

var pdf = renderer.RenderHtmlAsPdf("<h1>Content Here</h1>");
pdf.SaveAs("report.pdf");
using IronPdf;

var renderer = new ChromePdfRenderer();

// HTML header with full CSS support
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter
{
    HtmlFragment = @"
        <div style='width: 100%; text-align: center; font-size: 12pt; border-bottom: 1px solid #ccc;'>
            Company Report
        </div>",
    MaxHeight = 30
};

// HTML footer with page numbers
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter
{
    HtmlFragment = @"
        <div style='width: 100%; text-align: center; font-size: 10pt;'>
            Page {page} of {total-pages}
        </div>",
    MaxHeight = 25
};

var pdf = renderer.RenderHtmlAsPdf("<h1>Content Here</h1>");
pdf.SaveAs("report.pdf");
$vbLabelText   $csharpLabel

Scryber.Core requires XML-based header/footer definition with proprietary placeholders like {{pagenum}} and {{pagetotal}}. IronPDF uses full HTML/CSS for headers and footers with {page} and {total-pages} placeholders.


New Capabilities After Migration

After migrating to IronPDF, you gain capabilities that Scryber.Core cannot provide:

PDF Merging

var pdf1 = PdfDocument.FromFile("chapter1.pdf");
var pdf2 = PdfDocument.FromFile("chapter2.pdf");
var pdf3 = PdfDocument.FromFile("chapter3.pdf");

var merged = PdfDocument.Merge(pdf1, pdf2, pdf3);
merged.SaveAs("complete_book.pdf");
var pdf1 = PdfDocument.FromFile("chapter1.pdf");
var pdf2 = PdfDocument.FromFile("chapter2.pdf");
var pdf3 = PdfDocument.FromFile("chapter3.pdf");

var merged = PdfDocument.Merge(pdf1, pdf2, pdf3);
merged.SaveAs("complete_book.pdf");
$vbLabelText   $csharpLabel

Security and Metadata

var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Confidential</h1>");

// Metadata
pdf.MetaData.Title = "My Document";
pdf.MetaData.Author = "John Doe";
pdf.MetaData.Subject = "Annual Report";
pdf.MetaData.Keywords = "report, annual, confidential";

// Security
pdf.SecuritySettings.OwnerPassword = "owner123";
pdf.SecuritySettings.UserPassword = "user456";
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights;

pdf.SaveAs("protected.pdf");
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Confidential</h1>");

// Metadata
pdf.MetaData.Title = "My Document";
pdf.MetaData.Author = "John Doe";
pdf.MetaData.Subject = "Annual Report";
pdf.MetaData.Keywords = "report, annual, confidential";

// Security
pdf.SecuritySettings.OwnerPassword = "owner123";
pdf.SecuritySettings.UserPassword = "user456";
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights;

pdf.SaveAs("protected.pdf");
$vbLabelText   $csharpLabel

Feature Comparison Summary

FeatureScryber.CoreIronPDF
HTML to PDFBasicFull Chromium
URL to PDFManual fetchNative support
CSS GridLimitedFull support
FlexboxLimitedFull support
JavaScriptNoFull ES2024
Data BindingProprietary XMLUse Razor/Handlebars
Headers/FootersXML-basedHTML/CSS
Merge PDFsLimitedBuilt-in
Split PDFsNoYes
WatermarksBasicFull HTML
Digital SignaturesNoYes
PDF/ANoYes
Password ProtectionBasicFull
Async SupportLimitedFull
Cross-PlatformYesYes

Migration Checklist

Pre-Migration

  • Audit all Scryber templates for XML/binding patterns
  • Document data binding patterns used ({{model.Property}})
  • Identify custom styles that need CSS conversion
  • Obtain IronPDF license key from ironpdf.com

Code Updates

  • Remove Scryber.Core NuGet package
  • Install IronPdf NuGet package
  • Update namespace imports (using Scryber.Core;using IronPdf;)
  • Replace Document.ParseDocument(html, ParseSourceType.DynamicContent) with renderer.RenderHtmlAsPdf(html)
  • Replace doc.SaveAsPDF() with pdf.SaveAs()
  • Convert XML templates to HTML
  • Replace proprietary binding with standard templating (Razor/string interpolation)
  • Update page settings: doc.RenderOptions.PaperSizerenderer.RenderingOptions.PaperSize
  • Convert headers/footers to HTML format with {page} and {total-pages} placeholders
  • Add license initialization at application startup

Testing

  • Test all document templates
  • Verify styling matches (leverage full CSS support)
  • Test data binding with new templating
  • Verify page breaks
  • Test headers/footers with page number placeholders
  • Performance comparison

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