Ir para o conteúdo do rodapé
GUIAS DE MIGRAçãO

Como migrar do Syncfusion PDF para o IronPDF em C#

Full Comparison

Looking for a detailed feature-by-feature breakdown? See how IronPDF stacks up against Syncfusion PDF on pricing, HTML support, and licensing.

View Full Comparison

A migração do PDF da Syncfusion Framework para o IronPDF transforma seu fluxo de trabalho de geração de PDFs, passando de uma API gráfica baseada em coordenadas, integrada a um pacote extenso, para uma biblioteca independente, com foco em HTML/CSS e renderização moderna do Chromium. Este guia fornece um caminho de migração completo, passo a passo, que elimina o licenciamento exclusivo de pacotes, os requisitos complexos de implantação e o posicionamento baseado em coordenadas.

Por que migrar do PDF da Syncfusion para o IronPDF?

Entendendo a estrutura PDF da Syncfusion

O PDF da Syncfusion Framework é uma biblioteca abrangente que fornece uma ampla gama de funcionalidades para criar, editar e proteger documentos PDF usando C#. Ele faz parte do Essential Studio da Syncfusion, que inclui mais de mil componentes para diversas plataformas.

No entanto, uma de suas desvantagens mais significativas é que não pode ser adquirido como um produto independente; Os desenvolvedores precisam adquirir o pacote completo de componentes da Syncfusion. Esse requisito pode ser problemático para equipes interessadas apenas em funcionalidades de PDF, especialmente porque esse pacote pode incluir ferramentas desnecessárias para seus projetos.

O problema do licenciamento por pacote

O modelo de licenciamento da Syncfusion cria desafios significativos para equipes que precisam apenas da funcionalidade de PDF:

  1. Compra somente do pacote: Não é possível comprar a biblioteca de PDFs separadamente — é necessário adquirir o pacote Essential Studio completo.
  2. Restrições da Licença Comunitária: O nível gratuito exige receita inferior a US$ 1 milhão E menos de 5 desenvolvedores.
  3. Licenciamento para Implantações Complexas: Licenças diferentes para implantações web, desktop e servidor.
  4. Renovação anual obrigatória: Modelo de assinatura com custos anuais.
  5. Preços por desenvolvedor: os custos aumentam linearmente com o tamanho da equipe.
  6. Excesso de componentes: Inclui mais de 1000 componentes que você pode não precisar.

Comparação entre PDF da Syncfusion e IronPDF

Aspecto PDF da Syncfusion IronPDF
Modelo de compra Pacote somente para suítes Independente
Licenciamento Níveis complexos Simples por desenvolvedor
Limite da Comunidade <$1M AND <5 devs Teste grátis, depois licença
Implantação Vários tipos de licença Uma única licença cobre tudo.
Estilo API Gráficos baseados em coordenadas HTML/CSS em primeiro lugar
Suporte a HTML Requer BlinkBinaries Cromo nativo
Suporte a CSS Limitado CSS3 completo/flexbox/grid
Dependências Vários pacotes NuGet único
Requisitos da Suíte Sim (conjunto completo) Não
Foco no PDF Largo; parte de um conjunto maior Estreito; com foco em PDF

O IronPDF oferece uma abordagem mais focada, disponibilizando seus recursos de PDF como um produto independente. Essa diferença impacta significativamente tanto as considerações de custo quanto a facilidade de integração.

Para equipes que planejam a adoção do .NET 10 e do C# 14 até 2025 e 2026, o licenciamento independente do IronPDF e sua abordagem que prioriza HTML/CSS oferecem flexibilidade sem dependências de pacotes de software.


Antes de começar

Pré-requisitos

  1. Ambiente .NET : .NET Framework 4.6.2+ ou .NET Core 3.1+ / .NET 5/6/7/8/9+
  2. Acesso ao NuGet : Capacidade de instalar pacotes NuGet.
  3. Licença do IronPDF : Obtenha sua chave de licença em IronPDF

Alterações no pacote NuGet

# Remove Syncfusion packages
dotnet remove package Syncfusion.Pdf.Net.Core
dotnet remove package Syncfusion.HtmlToPdfConverter.Net.Windows
dotnet remove package Syncfusion.Licensing

# Install IronPDF
dotnet add package IronPdf
# Remove Syncfusion packages
dotnet remove package Syncfusion.Pdf.Net.Core
dotnet remove package Syncfusion.HtmlToPdfConverter.Net.Windows
dotnet remove package Syncfusion.Licensing

# Install IronPDF
dotnet add package IronPdf
SHELL

Configuração de licença

Syncfusion:

// Must register before any Syncfusion calls
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR-SYNCFUSION-KEY");
// Must register before any Syncfusion calls
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR-SYNCFUSION-KEY");
' Must register before any Syncfusion calls
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR-SYNCFUSION-KEY")
$vbLabelText   $csharpLabel

IronPDF:

// One-time at startup
IronPdf.License.LicenseKey = "YOUR-IRONPDF-KEY";
// One-time at startup
IronPdf.License.LicenseKey = "YOUR-IRONPDF-KEY";
' One-time at startup
IronPdf.License.LicenseKey = "YOUR-IRONPDF-KEY"
$vbLabelText   $csharpLabel

Referência completa da API

Alterações de namespace

// Before: Syncfusion PDF
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Parsing;
using Syncfusion.HtmlConverter;
using Syncfusion.Drawing;

// After: IronPDF
using IronPdf;
using IronPdf.Rendering;
// Before: Syncfusion PDF
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Parsing;
using Syncfusion.HtmlConverter;
using Syncfusion.Drawing;

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

Mapeamentos da API principal

Syncfusion IronPDF
PdfDocument ChromePdfRenderer
PdfLoadedDocument PdfDocument.FromFile()
HtmlToPdfConverter ChromePdfRenderer
graphics.DrawString() Elementos de texto HTML
graphics.DrawImage() <img> tag
PdfGrid HTML <table>
PdfStandardFont CSS font-family
PdfBrushes.Black CSS color: black
document.Security pdf.SecuritySettings
PdfTextExtractor pdf.ExtractAllText()
ImportPageRange() PdfDocument.Merge()
document.Save(stream) pdf.SaveAs(path)
document.Close(true) Não é necessário

Exemplos de migração de código

Exemplo 1: Conversão de HTML/URL para PDF

Antes (PDF da Syncfusion):

// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.IO;

class Program
{
    static void Main()
    {
        // Initialize HTML to PDF converter
        HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();

        // Convert URL to PDF
        PdfDocument document = htmlConverter.Convert("https://www.example.com");

        // Save the document
        FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
        document.Save(fileStream);
        document.Close(true);
        fileStream.Close();
    }
}
// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.IO;

class Program
{
    static void Main()
    {
        // Initialize HTML to PDF converter
        HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();

        // Convert URL to PDF
        PdfDocument document = htmlConverter.Convert("https://www.example.com");

        // Save the document
        FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
        document.Save(fileStream);
        document.Close(true);
        fileStream.Close();
    }
}
Imports Syncfusion.HtmlConverter
Imports Syncfusion.Pdf
Imports System.IO

Module Program
    Sub Main()
        ' Initialize HTML to PDF converter
        Dim htmlConverter As New HtmlToPdfConverter()

        ' Convert URL to PDF
        Dim document As PdfDocument = htmlConverter.Convert("https://www.example.com")

        ' Save the document
        Dim fileStream As New FileStream("Output.pdf", FileMode.Create)
        document.Save(fileStream)
        document.Close(True)
        fileStream.Close()
    End Sub
End Module
$vbLabelText   $csharpLabel

Após (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;

class Program
{
    static void Main()
    {
        // Create a PDF from a URL
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderUrlAsPdf("https://www.example.com");

        // Save the PDF
        pdf.SaveAs("Output.pdf");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;

class Program
{
    static void Main()
    {
        // Create a PDF from a URL
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderUrlAsPdf("https://www.example.com");

        // Save the PDF
        pdf.SaveAs("Output.pdf");
    }
}
Imports IronPdf

Class Program
    Shared Sub Main()
        ' Create a PDF from a URL
        Dim renderer = New ChromePdfRenderer()
        Dim pdf = renderer.RenderUrlAsPdf("https://www.example.com")

        ' Save the PDF
        pdf.SaveAs("Output.pdf")
    End Sub
End Class
$vbLabelText   $csharpLabel

Este exemplo demonstra as diferenças fundamentais da API. O PDF da Syncfusion requer uma instância de HtmlToPdfConverter, chamando Convert() que retorna um PdfDocument, então criando manualmente um FileStream, salvando e fechando o documento e o fluxo.

IronPDF usa um ChromePdfRenderer com RenderUrlAsPdf() em apenas três linhas de código. Sem gerenciamento de código 4079, sem chamadas de código 4080 — o IronPDF lida com a limpeza automaticamente. Consulte a documentação de conversão de HTML para PDF para obter exemplos completos.

Exemplo 2: Criando um PDF a partir de um texto

Antes (PDF da Syncfusion):

// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Drawing;
using System.IO;

class Program
{
    static void Main()
    {
        // Create a new PDF document
        PdfDocument document = new PdfDocument();

        // Add a page
        PdfPage page = document.Pages.Add();

        // Create a font
        PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);

        // Draw text
        page.Graphics.DrawString("Hello, World!", font, PdfBrushes.Black, new PointF(10, 10));

        // Save the document
        FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
        document.Save(fileStream);
        document.Close(true);
        fileStream.Close();
    }
}
// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Drawing;
using System.IO;

class Program
{
    static void Main()
    {
        // Create a new PDF document
        PdfDocument document = new PdfDocument();

        // Add a page
        PdfPage page = document.Pages.Add();

        // Create a font
        PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);

        // Draw text
        page.Graphics.DrawString("Hello, World!", font, PdfBrushes.Black, new PointF(10, 10));

        // Save the document
        FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
        document.Save(fileStream);
        document.Close(true);
        fileStream.Close();
    }
}
Imports Syncfusion.Pdf
Imports Syncfusion.Pdf.Graphics
Imports Syncfusion.Drawing
Imports System.IO

Module Program
    Sub Main()
        ' Create a new PDF document
        Dim document As New PdfDocument()

        ' Add a page
        Dim page As PdfPage = document.Pages.Add()

        ' Create a font
        Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)

        ' Draw text
        page.Graphics.DrawString("Hello, World!", font, PdfBrushes.Black, New PointF(10, 10))

        ' Save the document
        Dim fileStream As New FileStream("Output.pdf", FileMode.Create)
        document.Save(fileStream)
        document.Close(True)
        fileStream.Close()
    End Sub
End Module
$vbLabelText   $csharpLabel

Após (IronPDF):

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

class Program
{
    static void Main()
    {
        // Create a PDF from HTML string
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderHtmlAsPdf("<h1>Hello, World!</h1>");

        // Save the document
        pdf.SaveAs("Output.pdf");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;

class Program
{
    static void Main()
    {
        // Create a PDF from HTML string
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderHtmlAsPdf("<h1>Hello, World!</h1>");

        // Save the document
        pdf.SaveAs("Output.pdf");
    }
}
Imports IronPdf
Imports IronPdf.Rendering

Class Program
    Shared Sub Main()
        ' Create a PDF from HTML string
        Dim renderer As New ChromePdfRenderer()
        Dim pdf = renderer.RenderHtmlAsPdf("<h1>Hello, World!</h1>")

        ' Save the document
        pdf.SaveAs("Output.pdf")
    End Sub
End Class
$vbLabelText   $csharpLabel

O PDF da Syncfusion utiliza um modelo gráfico baseado em coordenadas. Você cria um PdfDocument, adiciona um PdfPage, cria um PdfFont com PdfFontFamily.Helvetica, e então chama page.Graphics.DrawString() com coordenadas explícitas (new PointF(10, 10)), fonte e pincel (PdfBrushes.Black). Finalmente, você gerencia a criação e o descarte de FileStream.

O IronPDF utiliza uma abordagem que prioriza HTML/CSS. Instead of coordinates, you write <h1>Hello, World!</h1> and let CSS handle positioning, fonts, and colors. Essa abordagem é mais simples, mais fácil de manter e aproveita as habilidades que os desenvolvedores já possuem. Saiba mais em nossos tutoriais .

Exemplo 3: Mesclar documentos PDF

Antes (PDF da Syncfusion):

// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.Pdf;
using Syncfusion.Pdf.Parsing;
using System.IO;

class Program
{
    static void Main()
    {
        // Load the first PDF document
        FileStream stream1 = new FileStream("Document1.pdf", FileMode.Open, FileAccess.Read);
        PdfLoadedDocument loadedDocument1 = new PdfLoadedDocument(stream1);

        // Load the second PDF document
        FileStream stream2 = new FileStream("Document2.pdf", FileMode.Open, FileAccess.Read);
        PdfLoadedDocument loadedDocument2 = new PdfLoadedDocument(stream2);

        // Merge the documents
        PdfDocument finalDocument = new PdfDocument();
        finalDocument.ImportPageRange(loadedDocument1, 0, loadedDocument1.Pages.Count - 1);
        finalDocument.ImportPageRange(loadedDocument2, 0, loadedDocument2.Pages.Count - 1);

        // Save the merged document
        FileStream outputStream = new FileStream("Merged.pdf", FileMode.Create);
        finalDocument.Save(outputStream);

        // Close all documents
        finalDocument.Close(true);
        loadedDocument1.Close(true);
        loadedDocument2.Close(true);
        stream1.Close();
        stream2.Close();
        outputStream.Close();
    }
}
// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.Pdf;
using Syncfusion.Pdf.Parsing;
using System.IO;

class Program
{
    static void Main()
    {
        // Load the first PDF document
        FileStream stream1 = new FileStream("Document1.pdf", FileMode.Open, FileAccess.Read);
        PdfLoadedDocument loadedDocument1 = new PdfLoadedDocument(stream1);

        // Load the second PDF document
        FileStream stream2 = new FileStream("Document2.pdf", FileMode.Open, FileAccess.Read);
        PdfLoadedDocument loadedDocument2 = new PdfLoadedDocument(stream2);

        // Merge the documents
        PdfDocument finalDocument = new PdfDocument();
        finalDocument.ImportPageRange(loadedDocument1, 0, loadedDocument1.Pages.Count - 1);
        finalDocument.ImportPageRange(loadedDocument2, 0, loadedDocument2.Pages.Count - 1);

        // Save the merged document
        FileStream outputStream = new FileStream("Merged.pdf", FileMode.Create);
        finalDocument.Save(outputStream);

        // Close all documents
        finalDocument.Close(true);
        loadedDocument1.Close(true);
        loadedDocument2.Close(true);
        stream1.Close();
        stream2.Close();
        outputStream.Close();
    }
}
Imports Syncfusion.Pdf
Imports Syncfusion.Pdf.Parsing
Imports System.IO

Class Program
    Shared Sub Main()
        ' Load the first PDF document
        Dim stream1 As New FileStream("Document1.pdf", FileMode.Open, FileAccess.Read)
        Dim loadedDocument1 As New PdfLoadedDocument(stream1)

        ' Load the second PDF document
        Dim stream2 As New FileStream("Document2.pdf", FileMode.Open, FileAccess.Read)
        Dim loadedDocument2 As New PdfLoadedDocument(stream2)

        ' Merge the documents
        Dim finalDocument As New PdfDocument()
        finalDocument.ImportPageRange(loadedDocument1, 0, loadedDocument1.Pages.Count - 1)
        finalDocument.ImportPageRange(loadedDocument2, 0, loadedDocument2.Pages.Count - 1)

        ' Save the merged document
        Dim outputStream As New FileStream("Merged.pdf", FileMode.Create)
        finalDocument.Save(outputStream)

        ' Close all documents
        finalDocument.Close(True)
        loadedDocument1.Close(True)
        loadedDocument2.Close(True)
        stream1.Close()
        stream2.Close()
        outputStream.Close()
    End Sub
End Class
$vbLabelText   $csharpLabel

Após (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        // Load PDF documents
        var pdf1 = PdfDocument.FromFile("Document1.pdf");
        var pdf2 = PdfDocument.FromFile("Document2.pdf");

        // Merge PDFs
        var merged = PdfDocument.Merge(new List<PdfDocument> { pdf1, pdf2 });

        // Save the merged document
        merged.SaveAs("Merged.pdf");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        // Load PDF documents
        var pdf1 = PdfDocument.FromFile("Document1.pdf");
        var pdf2 = PdfDocument.FromFile("Document2.pdf");

        // Merge PDFs
        var merged = PdfDocument.Merge(new List<PdfDocument> { pdf1, pdf2 });

        // Save the merged document
        merged.SaveAs("Merged.pdf");
    }
}
Imports IronPdf
Imports System.Collections.Generic

Class Program
    Shared Sub Main()
        ' Load PDF documents
        Dim pdf1 = PdfDocument.FromFile("Document1.pdf")
        Dim pdf2 = PdfDocument.FromFile("Document2.pdf")

        ' Merge PDFs
        Dim merged = PdfDocument.Merge(New List(Of PdfDocument) From {pdf1, pdf2})

        ' Save the merged document
        merged.SaveAs("Merged.pdf")
    End Sub
End Class
$vbLabelText   $csharpLabel

O contraste na fusão de PDFs é impressionante. O PDF da Syncfusion requer a criação de objetos FileStream para cada documento de entrada, carregando-os como PdfLoadedDocument, criando um novo PdfDocument, chamando ImportPageRange() com índices de início e fim para cada fonte, criando uma saída FileStream e, em seguida, fechando seis objetos separados (finalDocument, loadedDocument1, loadedDocument2, stream1, stream2, outputStream).

IronPDF usa PdfDocument.FromFile() para carregar cada PDF e um método estático PdfDocument.Merge() que aceita uma lista de documentos. Sem gerenciamento de fluxos, sem cálculos manuais de intervalo de páginas, sem situações de quase-acidente.


Principais diferenças na filosofia da API

Baseado em coordenadas versus HTML/CSS como primeiro passo

O PDF da Syncfusion utiliza um modelo gráfico baseado em coordenadas, herdado das bibliotecas PDF tradicionais:

// Syncfusion: Manual positioning
page.Graphics.DrawString("Text", font, PdfBrushes.Black, new PointF(100, 200));
page.Graphics.DrawRectangle(brush, new RectangleF(50, 50, 200, 100));
// Syncfusion: Manual positioning
page.Graphics.DrawString("Text", font, PdfBrushes.Black, new PointF(100, 200));
page.Graphics.DrawRectangle(brush, new RectangleF(50, 50, 200, 100));
' Syncfusion: Manual positioning
page.Graphics.DrawString("Text", font, PdfBrushes.Black, New PointF(100, 200))
page.Graphics.DrawRectangle(brush, New RectangleF(50, 50, 200, 100))
$vbLabelText   $csharpLabel

O IronPDF utiliza HTML/CSS para o layout:

// IronPDF: CSS-based positioning
var html = @"
<div style='margin: 50px; padding: 20px; border: 1px solid black;'>
    <p style='color: black;'>Text</p>
</div>";
var pdf = renderer.RenderHtmlAsPdf(html);
// IronPDF: CSS-based positioning
var html = @"
<div style='margin: 50px; padding: 20px; border: 1px solid black;'>
    <p style='color: black;'>Text</p>
</div>";
var pdf = renderer.RenderHtmlAsPdf(html);
' IronPDF: CSS-based positioning
Dim html As String = "
<div style='margin: 50px; padding: 20px; border: 1px solid black;'>
    <p style='color: black;'>Text</p>
</div>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
$vbLabelText   $csharpLabel

A abordagem HTML/CSS é mais intuitiva para desenvolvedores web, mais fácil de manter e produz resultados consistentes em diferentes tamanhos de página.

Gerenciamento de fluxo versus limpeza automática

O PDF da Syncfusion exige o descarte explícito de fluxos e documentos:

// Syncfusion: Manual cleanup
FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
document.Save(fileStream);
document.Close(true);
fileStream.Close();
// Syncfusion: Manual cleanup
FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
document.Save(fileStream);
document.Close(true);
fileStream.Close();
' Syncfusion: Manual cleanup
Dim fileStream As New FileStream("Output.pdf", FileMode.Create)
document.Save(fileStream)
document.Close(True)
fileStream.Close()
$vbLabelText   $csharpLabel

O IronPDF realiza a limpeza automaticamente:

// IronPDF: Automático cleanup
pdf.SaveAs("Output.pdf");
// IronPDF: Automático cleanup
pdf.SaveAs("Output.pdf");
$vbLabelText   $csharpLabel

Comparação de recursos

Recurso PDF da Syncfusion IronPDF
Compra avulsa Não (somente suíte) Sim
Licenciamento Comercial com restrições comunitárias Comercial simplificado
HTML para PDF Requer BlinkBinaries Cromo nativo
Suporte a CSS3 Limitado Completo (flexbox, grade)
Estilo API Gráficos baseados em coordenadas HTML/CSS em primeiro lugar
Gestão de Fluxos Manual Automático
Dependências Vários pacotes NuGet único
Complexidade de Implantação Potencialmente complexo Direto

Lista de verificação para migração

Pré-migração

  • Inventariar todas as utilizações de PDF da Syncfusion na base de código.
  • Documentar os custos de licenciamento e os requisitos de implementação.
  • Identificar os usos de PdfGrid, PdfGraphics e HtmlToPdfConverter
  • Obtenha a chave de licença do IronPDF em IronPDF

Atualizações de código

  • Remover pacotes Syncfusion (Syncfusion.Pdf.Net.Core, Syncfusion.HtmlToPdfConverter.Net.Windows, Syncfusion.Licensing)
  • Instale o pacote NuGet IronPdf
  • Atualizar importações de namespace (using Syncfusion.Pdf;using IronPdf;)
  • Substitua Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense() por IronPdf.License.LicenseKey = "..." Substitua HtmlToPdfConverter.Convert() por ChromePdfRenderer.RenderUrlAsPdf() ou RenderHtmlAsPdf()
  • Substitua PdfDocument + Pages.Add() + Graphics.DrawString() por ChromePdfRenderer.RenderHtmlAsPdf()
  • Substitua PdfLoadedDocument por PdfDocument.FromFile()
  • Substitua ImportPageRange() por PdfDocument.Merge()
  • Substitua document.Save(stream) por pdf.SaveAs(path)
  • Remover todas as chamadas document.Close(true) e stream.Close()
  • Substitua PdfGrid por elementos HTML <table>
  • Substitua PdfStandardFont por CSS font-family
  • Substitua PdfBrushes pelas propriedades CSS color

Testando

  • Comparação visual da saída em PDF
  • Verificar melhorias na renderização de CSS (flexbox e grid agora funcionam)
  • Teste de extração de texto
  • Teste de fusão e divisão
  • Comparação de desempenho

Curtis Chau
Redator Técnico

Curtis Chau é bacharel em Ciência da Computação (Universidade Carleton) e se especializa em desenvolvimento front-end, com experiência em Node.js, TypeScript, JavaScript e React. Apaixonado por criar interfaces de usuário intuitivas e esteticamente agradáveis, Curtis gosta de trabalhar com frameworks modernos e criar manuais ...

Leia mais

Equipe de suporte de ferro

Estamos online 24 horas por dia, 5 dias por semana.
Bater papo
E-mail
Liga para mim