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
- 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
- Custom Template Syntax: Proprietary binding syntax requires learning curve
- Limited CSS Support: Not a full browser-based renderer
- Smaller Community: Less documentation and community examples
- No JavaScript Execution: Static rendering only
- Complex Configuration: XML-heavy configuration approach
- Limited Commercial Support: Scryber.Core is primarily community-supported
Scryber.Core vs IronPDF Comparison
| Aspect | Scryber.Core | IronPDF |
|---|---|---|
| License | LGPL (restrictive) | Commercial |
| Rendering Engine | Custom | Chromium |
| CSS Support | Limited | Full CSS3 |
| JavaScript | No | Full ES2024 |
| Template Binding | Proprietary XML | Standard (Razor, etc.) |
| Learning Curve | Custom syntax | Standard HTML/CSS |
| Async Support | Limited | Full |
| Documentation | Basic | Extensive |
| Community Support | Smaller | Large |
| Commercial Support | Limited | Professional 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
- .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 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 IronPdfLicense Configuration
// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";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;Core API Mappings
| Scryber.Core | IronPDF | Notes |
|---|---|---|
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.BinaryData | Get stream/bytes |
doc.Info.Title | pdf.MetaData.Title | Metadata |
doc.Info.Author | pdf.MetaData.Author | Metadata |
PDFPage | pdf.Pages[i] | Page access |
PDFLayoutDocument | RenderingOptions | Layout control |
PDFStyle | CSS in HTML | Styling |
doc.RenderOptions.PaperSize | RenderingOptions.PaperSize | Paper size |
Data binding ({{value}}) | Razor/String interpolation | Templating |
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");
}
}
}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");
}
}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");
}
}
}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");
}
}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");
}
}
}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");
}
}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>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);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>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");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");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");Feature Comparison Summary
| Feature | Scryber.Core | IronPDF |
|---|---|---|
| HTML to PDF | Basic | Full Chromium |
| URL to PDF | Manual fetch | Native support |
| CSS Grid | Limited | Full support |
| Flexbox | Limited | Full support |
| JavaScript | No | Full ES2024 |
| Data Binding | Proprietary XML | Use Razor/Handlebars |
| Headers/Footers | XML-based | HTML/CSS |
| Merge PDFs | Limited | Built-in |
| Split PDFs | No | Yes |
| Watermarks | Basic | Full HTML |
| Digital Signatures | No | Yes |
| PDF/A | No | Yes |
| Password Protection | Basic | Full |
| Async Support | Limited | Full |
| Cross-Platform | Yes | Yes |
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.CoreNuGet package - Install
IronPdfNuGet package - Update namespace imports (
using Scryber.Core;→using IronPdf;) - Replace
Document.ParseDocument(html, ParseSourceType.DynamicContent)withrenderer.RenderHtmlAsPdf(html) - Replace
doc.SaveAsPDF()withpdf.SaveAs() - Convert XML templates to HTML
- Replace proprietary binding with standard templating (Razor/string interpolation)
- Update page settings:
doc.RenderOptions.PaperSize→renderer.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






