Uma comparação entre IronPDF e Apryse C#
Por que comparar as bibliotecas IronPDF e Apryse C# para PDF?
IronPDF e Apryse C# são bibliotecas PDF de destaque para .NET, cada uma com pontos fortes únicos. O IronPDF se destaca na conversão de HTML para PDF com suporte completo ao Bootstrap e amplos recursos de edição. Enquanto isso, o Apryse é especializado em anotação e redação de documentos, atendendo às necessidades de conformidade empresarial.
Como desenvolvedor C#, você frequentemente enfrenta tarefas relacionadas a PDF ao criar aplicações que geram, editam ou exibem documentos. Uma biblioteca PDF confiável é crucial para a eficiência. Essas bibliotecas oferecem funções integradas para operações complexas como converter documentos, editar texto e manipular imagens em PDFs. Sem elas, seria necessário escrever toda a funcionalidade do zero, o que é demorado e propenso a erros.
Esta comparação analisa duas bibliotecas PDF populares: IronPDF e Apryse C#. O IronPDF oferece recursos confiáveis que simplificam operações com PDF em ambientes .NET, desde a conversão de HTML para PDF até edição avançada de documentos. O Apryse C# proporciona uma abordagem direta para manipulação de PDF, focando em eficiência e facilidade de uso. Esta análise explora as capacidades específicas de cada biblioteca para ajudá-lo a determinar a melhor opção para o seu projeto.
O que é a biblioteca Apryse C# para PDF?

Apryse C# é uma biblioteca PDF completa para aplicações .NET, projetada para simplificar a manipulação de PDFs em ambientes C#. Anteriormente conhecida como PDFTron SDK, oferece uma ampla gama de recursos e ferramentas para desenvolvedores que buscam capacidades precisas de manipulação de PDF.
Quais são os principais recursos oferecidos pelo Apryse C#?
- Integração fácil com projetos .NET: Integração suave com .NET, incluindo ASP.NET Core e aplicações tradicionais do .NET Framework.
- Criação e edição de documentos: Crie PDFs do zero ou edite existentes, incluindo texto, imagens, formulários e manipulação de páginas - reordenar, mesclar ou dividir.
- Conversão de HTML para PDF: Conversão direta de conteúdo HTML para formato PDF para faturas, relatórios e documentação de páginas web.
- Suporte extensivo a campos de formulário: Criação, edição e preenchimento programático confiável de campos de formulário PDF para fluxos de trabalho automatizados.
- Extração de texto e conteúdo: Extraia texto e conteúdo de PDFs para análise, ferramentas de busca e gerenciamento de conteúdo.
- Segurança e criptografia: Segurança completa incluindo criptografia de documentos, gerenciamento de permissões e assinaturas digitais.
- Recursos avançados de PDF: Suporte para anotações, marcadores e hiperlinks para PDFs interativos.
O que é a biblioteca IronPDF C#?

IronPDF é uma biblioteca PDF versátil desenvolvida para programadores .NET. Ela simplifica a manipulação complexa de PDFs, permitindo a criação, edição e conversão de documentos PDF diretamente em aplicações C#. Disponível para várias linguagens de programação, incluindo Java, Python e C#, o IronPDF atende a diversas necessidades de processamento de PDF com eficiência e confiabilidade.
Quais são os principais recursos oferecidos pelo IronPDF?
- Integração fluida com .NET: Integração fácil, suportando tanto o .NET Framework quanto o .NET Core, incluindo projetos ASP.NET.
- Conversão de HTML para PDF: Converta HTML para PDF com alta qualidade, ideal para relatórios, recibos e documentação a partir de templates HTML.
- Edição avançada de PDF: Recursos extensos de edição, incluindo adição de texto, imagens e gráficos vetoriais.
- Manipulação de formulários PDF: Crie, edite e preencha formulários PDF programaticamente para fluxos de trabalho automatizados de documentos.
- Extração de conteúdo: Extraia texto, imagens e metadados para análise de conteúdo e migração de dados.
- Segurança de documentos: Proteção por senha, criptografia e gerenciamento de permissões.
- Desempenho e escalabilidade: Otimizado para velocidade e processamento em grande volume em aplicações de alta demanda.
- Documentação completa: Documentação abrangente e equipe de suporte responsiva para auxílio na implementação.
- Compatibilidade com padrões PDF: Suporte a PDF/A, PDF/UA e outras especificações do setor.
Como criar um aplicativo de console em C#?
Criar um aplicativo de console no Visual Studio estabelece a base para projetos de desenvolvimento .NET, incluindo aqueles que utilizam bibliotecas PDF como IronPDF ou Apryse C#. Siga estes passos para começar:
Como iniciar o Visual Studio?
Abra o Visual Studio em seu computador. Se ainda não instalou o Visual Studio, faça o download e instale a partir do site oficial da Microsoft, selecionando a versão adequada para suas necessidades.
Como criar um novo projeto?
Assim que o Visual Studio abrir, selecione "Criar um novo projeto" no painel inicial.

Qual tipo de projeto devo escolher?
Na janela "Criar um novo projeto", você verá vários modelos de projeto. Digite "Console" na caixa de pesquisa ou encontre "Aplicativo de Console" na lista. Selecione o modelo específico para C#.

Como configurar meu projeto?
Após selecionar "Aplicativo de Console", clique em "Avançar". Configure seu novo projeto:
-
Nome do projeto: Insira um nome descritivo para seu projeto.
-
Localização: Escolha o local de salvamento de sua preferência.
-
Nome da solução: Por padrão, será igual ao nome do projeto, mas pode ser personalizado.

-
Framework: Selecione sua versão do .NET. A versão mais recente é geralmente recomendada, a menos que haja requisitos específicos.

Como concluir a criação do projeto?
Após configurar as definições do projeto, clique em "Criar". O Visual Studio irá configurar um novo projeto de aplicativo de console com um arquivo padrão Program.cs.
Como é a estrutura do projeto?
Explore a estrutura do projeto gerada no painel Solution Explorer. Você trabalhará principalmente com o arquivo Program.cs em aplicativos de console, onde escreverá seu código C#.
Como Instalo a Biblioteca IronPDF?
Integrar o IronPDF ao seu projeto .NET permite que você utilize todas as suas capacidades de manipulação de PDF. Diversos métodos de instalação oferecem flexibilidade de acordo com suas preferências de fluxo de trabalho.
Como Instalo Usando o Gerenciador de Pacotes NuGet?
O Gerenciador de Pacotes NuGet no Visual Studio fornece uma interface gráfica para gerenciar bibliotecas.
- Abra seu projeto no Visual Studio.
- Clique com o botão direito no seu projeto no Solution Explorer e selecione "Gerenciar Pacotes NuGet".
- Clique na guia "Procurar" e pesquise por "IronPDF".
- Selecione IronPDF nos resultados e clique em "Instalar".

Como Instalo Usando a Linha de Comando?
O Console do Gerenciador de Pacotes oferece instalação direta via linha de comando.
- Abra seu projeto no Visual Studio.
- Vá em Ferramentas > Gerenciador de Pacotes NuGet > Console do Gerenciador de Pacotes.
- Digite o seguinte comando:
Este comando instala a versão mais recente do IronPDF em seu projeto.
Como Faço o Download Direto do NuGet?
Você pode baixar o pacote manualmente antes da integração.
-
Acesse o site do NuGet e pesquise por "IronPDF".
-
Na página do pacote IronPDF, clique em "Download Package" para obter o arquivo .nupkg.

-
Adicione o pacote baixado manualmente através do Solution Explorer > clique com o botão direito no projeto > "Adicionar > Referência".
Cada método integra com sucesso o IronPDF, permitindo que você utilize seus recursos eficazes de processamento de PDF.
Como Instalo Apryse C#?
Integrar Apryse C# ao seu projeto varia conforme o ambiente .NET Framework ou .NET Core. Os passos a seguir descrevem o processo geral de instalação:
Como Instalo Apryse para .NET Framework?
-
Baixe o SDK Apryse para Windows: Você precisará acessar a página do SDK Apryse para Windows para baixar o SDK adequado para aplicações .NET Framework.

-
Extraia o SDK: Após o download, extraia o SDK para um local conhecido em seu sistema.
-
Obtenha uma Chave de Avaliação Apryse: Cadastre-se na plataforma Apryse para obter uma chave de avaliação, que será usada para ativar os recursos de avaliação do SDK.
-
Configure Seu Projeto: No Visual Studio, crie uma nova aplicação de console .NET Framework. Em seguida, adicione a pasta Lib do SDK extraído ao diretório do seu projeto.
-
Adicione Referências: Clique com o botão direito em Referências no seu projeto, escolha "Adicionar Referência" e navegue até a pasta Lib onde você copiou PDFNetLoader.dll e o PDFNet.dll apropriado para sua arquitetura (x86 ou x64). Certifique-se de definir a propriedade "Copy Local" do PDFNet.dll como false.
-
Configure o App.config: Certifique-se de que seu arquivo App.config tenha a configuração loadFromRemoteSources habilitada como true.
O SDK inclui pastas de exemplos que você pode abrir e executar diretamente como soluções.
Recursos Avançados do IronPDF
Conversão de HTML para PDF
O IronPDF é altamente eficaz na conversão de HTML para documentos PDF, um recurso crucial para aplicações web que geram relatórios, faturas ou capturas de páginas web. A biblioteca renderiza com precisão HTML, CSS e JavaScript, preservando o layout e os estilos do conteúdo web nos PDFs gerados.
Convertendo String HTML para PDF
Converter strings HTML diretamente para PDF permite a criação dinâmica de documentos a partir de conteúdo gerado pela aplicação ou variáveis armazenadas. Este método é útil para criar relatórios personalizados, recibos ou documentos baseados em entrada do usuário.
using IronPdf;
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
// Define a simple HTML string to convert to PDF
string htmlContent = @"
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>My PDF</title>
<style>
body {
font-family: Arial, sans-serif;
}
h1 {
color: #333;
text-align: center;
}
p {
color: #666;
text-align: justify;
}
</style>
</head>
<body>
<h1>Welcome to My PDF</h1>
<p>This is a sample paragraph demonstrating how to create a PDF from HTML using IronPdf in C#.</p>
<p>You can add more content here as needed.</p>
</body>
</html>";
// Render the HTML string as a PDF
var pdf = renderer.RenderHtmlAsPdf(htmlContent);
// Save the resulting PDF to a file
pdf.SaveAs("output.pdf");Imports IronPdf
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
' Define a simple HTML string to convert to PDF
Dim htmlContent As String = "
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>My PDF</title>
<style>
body {
font-family: Arial, sans-serif;
}
h1 {
color: #333;
text-align: center;
}
p {
color: #666;
text-align: justify;
}
</style>
</head>
<body>
<h1>Welcome to My PDF</h1>
<p>This is a sample paragraph demonstrating how to create a PDF from HTML using IronPdf in C#.</p>
<p>You can add more content here as needed.</p>
</body>
</html>"
' Render the HTML string as a PDF
Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)
' Save the resulting PDF to a file
pdf.SaveAs("output.pdf")Imports IronPdf
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
' Define a simple HTML string to convert to PDF
Dim htmlContent As String = "
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>My PDF</title>
<style>
body {
font-family: Arial, sans-serif;
}
h1 {
color: #333;
text-align: center;
}
p {
color: #666;
text-align: justify;
}
</style>
</head>
<body>
<h1>Welcome to My PDF</h1>
<p>This is a sample paragraph demonstrating how to create a PDF from HTML using IronPdf in C#.</p>
<p>You can add more content here as needed.</p>
</body>
</html>"
' Render the HTML string as a PDF
Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)
' Save the resulting PDF to a file
pdf.SaveAs("output.pdf")Convertendo Arquivo HTML para PDF
Se você possui arquivos HTML armazenados em disco, o IronPDF pode converter esses arquivos em documentos PDF. Este método é ideal para documentos HTML existentes, modelos ou relatórios salvos em seu projeto ou servidor.
using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
// Render the HTML file as a PDF
var pdf = renderer.RenderHtmlFileAsPdf("invoice.html");
// Save the resulting PDF to a file
pdf.SaveAs("file.pdf");using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
// Render the HTML file as a PDF
var pdf = renderer.RenderHtmlFileAsPdf("invoice.html");
// Save the resulting PDF to a file
pdf.SaveAs("file.pdf");Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
' Render the HTML file as a PDF
Dim pdf = renderer.RenderHtmlFileAsPdf("invoice.html")
' Save the resulting PDF to a file
pdf.SaveAs("file.pdf")Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
' Render the HTML file as a PDF
Dim pdf = renderer.RenderHtmlFileAsPdf("invoice.html")
' Save the resulting PDF to a file
pdf.SaveAs("file.pdf")Convertendo URL para PDF
O IronPDF pode converter páginas da web ao vivo em documentos PDF fornecendo a URL. Este recurso captura o estado atual da página, incluindo layouts complexos, CSS e conteúdo gerado por JavaScript.
using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
// Render the URL as a PDF
var pdf = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/en-us/download/dotnet-framework");
// Save the resulting PDF to a file
pdf.SaveAs("url.pdf");using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
// Render the URL as a PDF
var pdf = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/en-us/download/dotnet-framework");
// Save the resulting PDF to a file
pdf.SaveAs("url.pdf");Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
' Render the URL as a PDF
Dim pdf = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/en-us/download/dotnet-framework")
' Save the resulting PDF to a file
pdf.SaveAs("url.pdf")Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
' Render the URL as a PDF
Dim pdf = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/en-us/download/dotnet-framework")
' Save the resulting PDF to a file
pdf.SaveAs("url.pdf")Suporte para Bootstrap e Frameworks CSS Modernos
O suporte completo para Bootstrap e frameworks CSS é essencial ao gerar PDFs de aplicações web modernas. As organizações dependem do Bootstrap para interfaces web, tornando a conversão precisa para PDF fundamental para relatórios, faturas e documentação.
Recursos do Bootstrap Suportados pelo IronPDF
IronPDF: Suporte Completo ao Bootstrap
- Bootstrap 5: Suporte total para layouts flexbox, CSS Grid, classes utilitárias e componentes responsivos
- Bootstrap 4: Sistemas completos de cards, componentes de navegação e utilitários flex
- Tailwind CSS: Todas as classes utilitárias são renderizadas com precisão
- Foundation: Suporte completo ao sistema de grid e componentes
- CSS3 Moderno: Flexbox completo, CSS Grid, propriedades personalizadas, animações e transições
O IronPDF renderiza a página inicial do Bootstrap e todos os exemplos oficiais com precisão de pixels.
Exemplo de Código: Dashboard de Métricas de Negócios
using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
var renderer = new ChromePdfRenderer();
string bootstrapDashboard = @"
<!DOCTYPE html>
<html>
<head>
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
<style>
.metric-card { transition: transform 0.2s; }
.metric-card:hover { transform: translateY(-5px); }
.trend-up { color: #28a745; }
.trend-down { color: #dc3545; }
</style>
</head>
<body>
<div class='container-fluid py-4'>
<div class='d-flex justify-content-between align-items-center mb-4'>
<h1 class='display-5'>Business Performance Dashboard</h1>
<div class='text-muted'>Last updated: March 2025</div>
</div>
<div class='row g-4 mb-4'>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-primary border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Total Revenue</h6>
<span class='badge bg-primary'>Q1 2025</span>
</div>
<h2 class='mb-1'>$2.4M</h2>
<div class='trend-up'>
<i>↑</i> <strong>+18.5%</strong> from last quarter
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-success border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>New Customers</h6>
<span class='badge bg-success'>Active</span>
</div>
<h2 class='mb-1'>1,284</h2>
<div class='trend-up'>
<i>↑</i> <strong>+24.3%</strong> growth rate
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-warning border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Avg Order Value</h6>
<span class='badge bg-warning text-dark'>Updated</span>
</div>
<h2 class='mb-1'>$1,847</h2>
<div class='trend-up'>
<i>↑</i> <strong>+5.2%</strong> increase
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-info border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Satisfaction Rate</h6>
<span class='badge bg-info'>Excellent</span>
</div>
<h2 class='mb-1'>94.7%</h2>
<div class='trend-up'>
<i>↑</i> <strong>+2.1pts</strong> improvement
</div>
</div>
</div>
</div>
</div>
<div class='row g-4'>
<div class='col-md-8'>
<div class='card shadow-sm'>
<div class='card-header bg-white d-flex justify-content-between align-items-center'>
<h5 class='mb-0'>Revenue Breakdown by Category</h5>
<div class='btn-group btn-group-sm' role='group'>
<button type='button' class='btn btn-outline-primary active'>Monthly</button>
<button type='button' class='btn btn-outline-primary'>Quarterly</button>
<button type='button' class='btn btn-outline-primary'>Annual</button>
</div>
</div>
<div class='card-body'>
<div class='table-responsive'>
<table class='table table-hover mb-0'>
<thead class='table-light'>
<tr>
<th>Category</th>
<th>Revenue</th>
<th>Orders</th>
<th>Avg Value</th>
<th class='text-end'>Trend</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class='badge bg-primary me-2'>A</span>Enterprise Solutions</td>
<td><strong>$1,245,000</strong></td>
<td>142</td>
<td>$8,768</td>
<td class='text-end'><span class='badge bg-success'>+12%</span></td>
</tr>
<tr>
<td><span class='badge bg-success me-2'>B</span>Professional Services</td>
<td><strong>$687,500</strong></td>
<td>458</td>
<td>$1,501</td>
<td class='text-end'><span class='badge bg-success'>+18%</span></td>
</tr>
<tr>
<td><span class='badge bg-info me-2'>C</span>Standard Packages</td>
<td><strong>$412,300</strong></td>
<td>891</td>
<td>$463</td>
<td class='text-end'><span class='badge bg-success'>+8%</span></td>
</tr>
<tr>
<td><span class='badge bg-warning me-2'>D</span>Custom Development</td>
<td><strong>$55,200</strong></td>
<td>12</td>
<td>$4,600</td>
<td class='text-end'><span class='badge bg-danger'>-3%</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class='col-md-4'>
<div class='card shadow-sm'>
<div class='card-header bg-white'>
<h5 class='mb-0'>Quick Actions</h5>
</div>
<div class='card-body'>
<div class='d-grid gap-2'>
<button class='btn btn-primary'>Generate Full Report</button>
<button class='btn btn-outline-primary'>Export to Excel</button>
<button class='btn btn-outline-secondary'>Schedule Email</button>
<button class='btn btn-outline-info'>Share Dashboard</button>
</div>
</div>
</div>
<div class='card shadow-sm mt-3'>
<div class='card-header bg-white'>
<h5 class='mb-0'>Key Insights</h5>
</div>
<div class='card-body'>
<div class='alert alert-success mb-2'>
<small><strong>Top Performer:</strong> Enterprise Solutions leading revenue growth</small>
</div>
<div class='alert alert-info mb-2'>
<small><strong>Growth Driver:</strong> Professional Services showing strongest customer acquisition</small>
</div>
<div class='alert alert-warning mb-0'>
<small><strong>Attention Needed:</strong> Custom Development segment requires review</small>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>";
var pdf = renderer.RenderHtmlAsPdf(bootstrapDashboard);
pdf.SaveAs("business-dashboard.pdf");using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
var renderer = new ChromePdfRenderer();
string bootstrapDashboard = @"
<!DOCTYPE html>
<html>
<head>
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
<style>
.metric-card { transition: transform 0.2s; }
.metric-card:hover { transform: translateY(-5px); }
.trend-up { color: #28a745; }
.trend-down { color: #dc3545; }
</style>
</head>
<body>
<div class='container-fluid py-4'>
<div class='d-flex justify-content-between align-items-center mb-4'>
<h1 class='display-5'>Business Performance Dashboard</h1>
<div class='text-muted'>Last updated: March 2025</div>
</div>
<div class='row g-4 mb-4'>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-primary border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Total Revenue</h6>
<span class='badge bg-primary'>Q1 2025</span>
</div>
<h2 class='mb-1'>$2.4M</h2>
<div class='trend-up'>
<i>↑</i> <strong>+18.5%</strong> from last quarter
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-success border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>New Customers</h6>
<span class='badge bg-success'>Active</span>
</div>
<h2 class='mb-1'>1,284</h2>
<div class='trend-up'>
<i>↑</i> <strong>+24.3%</strong> growth rate
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-warning border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Avg Order Value</h6>
<span class='badge bg-warning text-dark'>Updated</span>
</div>
<h2 class='mb-1'>$1,847</h2>
<div class='trend-up'>
<i>↑</i> <strong>+5.2%</strong> increase
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-info border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Satisfaction Rate</h6>
<span class='badge bg-info'>Excellent</span>
</div>
<h2 class='mb-1'>94.7%</h2>
<div class='trend-up'>
<i>↑</i> <strong>+2.1pts</strong> improvement
</div>
</div>
</div>
</div>
</div>
<div class='row g-4'>
<div class='col-md-8'>
<div class='card shadow-sm'>
<div class='card-header bg-white d-flex justify-content-between align-items-center'>
<h5 class='mb-0'>Revenue Breakdown by Category</h5>
<div class='btn-group btn-group-sm' role='group'>
<button type='button' class='btn btn-outline-primary active'>Monthly</button>
<button type='button' class='btn btn-outline-primary'>Quarterly</button>
<button type='button' class='btn btn-outline-primary'>Annual</button>
</div>
</div>
<div class='card-body'>
<div class='table-responsive'>
<table class='table table-hover mb-0'>
<thead class='table-light'>
<tr>
<th>Category</th>
<th>Revenue</th>
<th>Orders</th>
<th>Avg Value</th>
<th class='text-end'>Trend</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class='badge bg-primary me-2'>A</span>Enterprise Solutions</td>
<td><strong>$1,245,000</strong></td>
<td>142</td>
<td>$8,768</td>
<td class='text-end'><span class='badge bg-success'>+12%</span></td>
</tr>
<tr>
<td><span class='badge bg-success me-2'>B</span>Professional Services</td>
<td><strong>$687,500</strong></td>
<td>458</td>
<td>$1,501</td>
<td class='text-end'><span class='badge bg-success'>+18%</span></td>
</tr>
<tr>
<td><span class='badge bg-info me-2'>C</span>Standard Packages</td>
<td><strong>$412,300</strong></td>
<td>891</td>
<td>$463</td>
<td class='text-end'><span class='badge bg-success'>+8%</span></td>
</tr>
<tr>
<td><span class='badge bg-warning me-2'>D</span>Custom Development</td>
<td><strong>$55,200</strong></td>
<td>12</td>
<td>$4,600</td>
<td class='text-end'><span class='badge bg-danger'>-3%</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class='col-md-4'>
<div class='card shadow-sm'>
<div class='card-header bg-white'>
<h5 class='mb-0'>Quick Actions</h5>
</div>
<div class='card-body'>
<div class='d-grid gap-2'>
<button class='btn btn-primary'>Generate Full Report</button>
<button class='btn btn-outline-primary'>Export to Excel</button>
<button class='btn btn-outline-secondary'>Schedule Email</button>
<button class='btn btn-outline-info'>Share Dashboard</button>
</div>
</div>
</div>
<div class='card shadow-sm mt-3'>
<div class='card-header bg-white'>
<h5 class='mb-0'>Key Insights</h5>
</div>
<div class='card-body'>
<div class='alert alert-success mb-2'>
<small><strong>Top Performer:</strong> Enterprise Solutions leading revenue growth</small>
</div>
<div class='alert alert-info mb-2'>
<small><strong>Growth Driver:</strong> Professional Services showing strongest customer acquisition</small>
</div>
<div class='alert alert-warning mb-0'>
<small><strong>Attention Needed:</strong> Custom Development segment requires review</small>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>";
var pdf = renderer.RenderHtmlAsPdf(bootstrapDashboard);
pdf.SaveAs("business-dashboard.pdf");Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
Dim renderer = New ChromePdfRenderer()
Dim bootstrapDashboard As String = "
<!DOCTYPE html>
<html>
<head>
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
<style>
.metric-card { transition: transform 0.2s; }
.metric-card:hover { transform: translateY(-5px); }
.trend-up { color: #28a745; }
.trend-down { color: #dc3545; }
</style>
</head>
<body>
<div class='container-fluid py-4'>
<div class='d-flex justify-content-between align-items-center mb-4'>
<h1 class='display-5'>Business Performance Dashboard</h1>
<div class='text-muted'>Last updated: March 2025</div>
</div>
<div class='row g-4 mb-4'>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-primary border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Total Revenue</h6>
<span class='badge bg-primary'>Q1 2025</span>
</div>
<h2 class='mb-1'>$2.4M</h2>
<div class='trend-up'>
<i>↑</i> <strong>+18.5%</strong> from last quarter
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-success border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>New Customers</h6>
<span class='badge bg-success'>Active</span>
</div>
<h2 class='mb-1'>1,284</h2>
<div class='trend-up'>
<i>↑</i> <strong>+24.3%</strong> growth rate
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-warning border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Avg Order Value</h6>
<span class='badge bg-warning text-dark'>Updated</span>
</div>
<h2 class='mb-1'>$1,847</h2>
<div class='trend-up'>
<i>↑</i> <strong>+5.2%</strong> increase
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-info border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Satisfaction Rate</h6>
<span class='badge bg-info'>Excellent</span>
</div>
<h2 class='mb-1'>94.7%</h2>
<div class='trend-up'>
<i>↑</i> <strong>+2.1pts</strong> improvement
</div>
</div>
</div>
</div>
</div>
<div class='row g-4'>
<div class='col-md-8'>
<div class='card shadow-sm'>
<div class='card-header bg-white d-flex justify-content-between align-items-center'>
<h5 class='mb-0'>Revenue Breakdown by Category</h5>
<div class='btn-group btn-group-sm' role='group'>
<button type='button' class='btn btn-outline-primary active'>Monthly</button>
<button type='button' class='btn btn-outline-primary'>Quarterly</button>
<button type='button' class='btn btn-outline-primary'>Annual</button>
</div>
</div>
<div class='card-body'>
<div class='table-responsive'>
<table class='table table-hover mb-0'>
<thead class='table-light'>
<tr>
<th>Category</th>
<th>Revenue</th>
<th>Orders</th>
<th>Avg Value</th>
<th class='text-end'>Trend</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class='badge bg-primary me-2'>A</span>Enterprise Solutions</td>
<td><strong>$1,245,000</strong></td>
<td>142</td>
<td>$8,768</td>
<td class='text-end'><span class='badge bg-success'>+12%</span></td>
</tr>
<tr>
<td><span class='badge bg-success me-2'>B</span>Professional Services</td>
<td><strong>$687,500</strong></td>
<td>458</td>
<td>$1,501</td>
<td class='text-end'><span class='badge bg-success'>+18%</span></td>
</tr>
<tr>
<td><span class='badge bg-info me-2'>C</span>Standard Packages</td>
<td><strong>$412,300</strong></td>
<td>891</td>
<td>$463</td>
<td class='text-end'><span class='badge bg-success'>+8%</span></td>
</tr>
<tr>
<td><span class='badge bg-warning me-2'>D</span>Custom Development</td>
<td><strong>$55,200</strong></td>
<td>12</td>
<td>$4,600</td>
<td class='text-end'><span class='badge bg-danger'>-3%</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class='col-md-4'>
<div class='card shadow-sm'>
<div class='card-header bg-white'>
<h5 class='mb-0'>Quick Actions</h5>
</div>
<div class='card-body'>
<div class='d-grid gap-2'>
<button class='btn btn-primary'>Generate Full Report</button>
<button class='btn btn-outline-primary'>Export to Excel</button>
<button class='btn btn-outline-secondary'>Schedule Email</button>
<button class='btn btn-outline-info'>Share Dashboard</button>
</div>
</div>
</div>
<div class='card shadow-sm mt-3'>
<div class='card-header bg-white'>
<h5 class='mb-0'>Key Insights</h5>
</div>
<div class='card-body'>
<div class='alert alert-success mb-2'>
<small><strong>Top Performer:</strong> Enterprise Solutions leading revenue growth</small>
</div>
<div class='alert alert-info mb-2'>
<small><strong>Growth Driver:</strong> Professional Services showing strongest customer acquisition</small>
</div>
<div class='alert alert-warning mb-0'>
<small><strong>Attention Needed:</strong> Custom Development segment requires review</small>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>"
Dim pdf = renderer.RenderHtmlAsPdf(bootstrapDashboard)
pdf.SaveAs("business-dashboard.pdf")Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
Dim renderer = New ChromePdfRenderer()
Dim bootstrapDashboard As String = "
<!DOCTYPE html>
<html>
<head>
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
<style>
.metric-card { transition: transform 0.2s; }
.metric-card:hover { transform: translateY(-5px); }
.trend-up { color: #28a745; }
.trend-down { color: #dc3545; }
</style>
</head>
<body>
<div class='container-fluid py-4'>
<div class='d-flex justify-content-between align-items-center mb-4'>
<h1 class='display-5'>Business Performance Dashboard</h1>
<div class='text-muted'>Last updated: March 2025</div>
</div>
<div class='row g-4 mb-4'>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-primary border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Total Revenue</h6>
<span class='badge bg-primary'>Q1 2025</span>
</div>
<h2 class='mb-1'>$2.4M</h2>
<div class='trend-up'>
<i>↑</i> <strong>+18.5%</strong> from last quarter
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-success border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>New Customers</h6>
<span class='badge bg-success'>Active</span>
</div>
<h2 class='mb-1'>1,284</h2>
<div class='trend-up'>
<i>↑</i> <strong>+24.3%</strong> growth rate
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-warning border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Avg Order Value</h6>
<span class='badge bg-warning text-dark'>Updated</span>
</div>
<h2 class='mb-1'>$1,847</h2>
<div class='trend-up'>
<i>↑</i> <strong>+5.2%</strong> increase
</div>
</div>
</div>
</div>
<div class='col-md-3'>
<div class='card metric-card shadow-sm border-start border-info border-4'>
<div class='card-body'>
<div class='d-flex justify-content-between align-items-center mb-2'>
<h6 class='text-muted text-uppercase mb-0'>Satisfaction Rate</h6>
<span class='badge bg-info'>Excellent</span>
</div>
<h2 class='mb-1'>94.7%</h2>
<div class='trend-up'>
<i>↑</i> <strong>+2.1pts</strong> improvement
</div>
</div>
</div>
</div>
</div>
<div class='row g-4'>
<div class='col-md-8'>
<div class='card shadow-sm'>
<div class='card-header bg-white d-flex justify-content-between align-items-center'>
<h5 class='mb-0'>Revenue Breakdown by Category</h5>
<div class='btn-group btn-group-sm' role='group'>
<button type='button' class='btn btn-outline-primary active'>Monthly</button>
<button type='button' class='btn btn-outline-primary'>Quarterly</button>
<button type='button' class='btn btn-outline-primary'>Annual</button>
</div>
</div>
<div class='card-body'>
<div class='table-responsive'>
<table class='table table-hover mb-0'>
<thead class='table-light'>
<tr>
<th>Category</th>
<th>Revenue</th>
<th>Orders</th>
<th>Avg Value</th>
<th class='text-end'>Trend</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class='badge bg-primary me-2'>A</span>Enterprise Solutions</td>
<td><strong>$1,245,000</strong></td>
<td>142</td>
<td>$8,768</td>
<td class='text-end'><span class='badge bg-success'>+12%</span></td>
</tr>
<tr>
<td><span class='badge bg-success me-2'>B</span>Professional Services</td>
<td><strong>$687,500</strong></td>
<td>458</td>
<td>$1,501</td>
<td class='text-end'><span class='badge bg-success'>+18%</span></td>
</tr>
<tr>
<td><span class='badge bg-info me-2'>C</span>Standard Packages</td>
<td><strong>$412,300</strong></td>
<td>891</td>
<td>$463</td>
<td class='text-end'><span class='badge bg-success'>+8%</span></td>
</tr>
<tr>
<td><span class='badge bg-warning me-2'>D</span>Custom Development</td>
<td><strong>$55,200</strong></td>
<td>12</td>
<td>$4,600</td>
<td class='text-end'><span class='badge bg-danger'>-3%</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class='col-md-4'>
<div class='card shadow-sm'>
<div class='card-header bg-white'>
<h5 class='mb-0'>Quick Actions</h5>
</div>
<div class='card-body'>
<div class='d-grid gap-2'>
<button class='btn btn-primary'>Generate Full Report</button>
<button class='btn btn-outline-primary'>Export to Excel</button>
<button class='btn btn-outline-secondary'>Schedule Email</button>
<button class='btn btn-outline-info'>Share Dashboard</button>
</div>
</div>
</div>
<div class='card shadow-sm mt-3'>
<div class='card-header bg-white'>
<h5 class='mb-0'>Key Insights</h5>
</div>
<div class='card-body'>
<div class='alert alert-success mb-2'>
<small><strong>Top Performer:</strong> Enterprise Solutions leading revenue growth</small>
</div>
<div class='alert alert-info mb-2'>
<small><strong>Growth Driver:</strong> Professional Services showing strongest customer acquisition</small>
</div>
<div class='alert alert-warning mb-0'>
<small><strong>Attention Needed:</strong> Custom Development segment requires review</small>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>"
Dim pdf = renderer.RenderHtmlAsPdf(bootstrapDashboard)
pdf.SaveAs("business-dashboard.pdf")Saída: PDF de dashboard empresarial profissional com o sistema de grid baseado em flexbox do Bootstrap 5, componentes de card com utilitários de borda, elementos de badge, tabelas responsivas e métricas codificadas por cor – tudo renderizado com preservação perfeita do layout e tipografia.
Limitações de Framework CSS do Apryse
O módulo HTML2PDF do Apryse utiliza um mecanismo de renderização personalizado (não Chromium) com limitações documentadas:
- Suporte parcial a flexbox: Layouts do Bootstrap 4/5 podem não ser renderizados corretamente
- CSS Grid limitado: Designs modernos baseados em grid frequentemente falham
- Restrições de JavaScript: Execução mínima em comparação com ambientes de navegador
- Compatibilidade de frameworks: Requer testes extensivos para componentes do Bootstrap
A documentação do HTML2PDF alerta explicitamente que CSS complexo pode não ser renderizado como esperado. Desenvolvedores relatam problemas com barras de navegação, layouts de cards baseados em flex e utilitários responsivos.
Impacto no desenvolvimento: Equipes que utilizam Apryse precisam criar CSS "seguro para PDF" em paralelo ou simplificar significativamente os layouts do Bootstrap, aumentando o esforço de desenvolvimento e limitando a consistência do design entre web e PDF.
Para suporte completo ao framework Bootstrap com renderização total de CSS3, consulte o Guia de Bootstrap & Flexbox CSS.
Mesclando e Dividindo PDFs
O IronPDF facilita a combinação de múltiplos documentos PDF ou a divisão de PDFs em arquivos menores. Essa funcionalidade é essencial para sistemas de gerenciamento de documentos que exigem uma estrutura organizada de conteúdo PDF.
using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Define HTML content for two PDFs to merge
var htmlA = @"
<h1>PDF A</h1>
<p>This is the content of PDF A.</p>
<p>This is the first page of PDF A.</p>
<div style='page-break-after: always;'></div>
<p>This is the second page of PDF A.</p>";
var htmlB = @"
<h1>PDF B</h1>
<p>This is the content of PDF B.</p>
<p>This is the first page of PDF B.</p>
<div style='page-break-after: always;'></div>
<p>This is the second page of PDF B.</p>";
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
// Render the HTML content as separate PDF documents
var pdfDocA = renderer.RenderHtmlAsPdf(htmlA);
var pdfDocB = renderer.RenderHtmlAsPdf(htmlB);
// Merge the two PDFs into one
var mergedPdf = PdfDocument.Merge(pdfDocA, pdfDocB);
// Save the merged PDF to a file
mergedPdf.SaveAs("Merged.pdf");using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Define HTML content for two PDFs to merge
var htmlA = @"
<h1>PDF A</h1>
<p>This is the content of PDF A.</p>
<p>This is the first page of PDF A.</p>
<div style='page-break-after: always;'></div>
<p>This is the second page of PDF A.</p>";
var htmlB = @"
<h1>PDF B</h1>
<p>This is the content of PDF B.</p>
<p>This is the first page of PDF B.</p>
<div style='page-break-after: always;'></div>
<p>This is the second page of PDF B.</p>";
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
// Render the HTML content as separate PDF documents
var pdfDocA = renderer.RenderHtmlAsPdf(htmlA);
var pdfDocB = renderer.RenderHtmlAsPdf(htmlB);
// Merge the two PDFs into one
var mergedPdf = PdfDocument.Merge(pdfDocA, pdfDocB);
// Save the merged PDF to a file
mergedPdf.SaveAs("Merged.pdf");Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Define HTML content for two PDFs to merge
Dim htmlA = "
<h1>PDF A</h1>
<p>This is the content of PDF A.</p>
<p>This is the first page of PDF A.</p>
<div style='page-break-after: always;'></div>
<p>This is the second page of PDF A.</p>"
Dim htmlB = "
<h1>PDF B</h1>
<p>This is the content of PDF B.</p>
<p>This is the first page of PDF B.</p>
<div style='page-break-after: always;'></div>
<p>This is the second page of PDF B.</p>"
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
' Render the HTML content as separate PDF documents
Dim pdfDocA = renderer.RenderHtmlAsPdf(htmlA)
Dim pdfDocB = renderer.RenderHtmlAsPdf(htmlB)
' Merge the two PDFs into one
Dim mergedPdf = PdfDocument.Merge(pdfDocA, pdfDocB)
' Save the merged PDF to a file
mergedPdf.SaveAs("Merged.pdf")Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Define HTML content for two PDFs to merge
Dim htmlA = "
<h1>PDF A</h1>
<p>This is the content of PDF A.</p>
<p>This is the first page of PDF A.</p>
<div style='page-break-after: always;'></div>
<p>This is the second page of PDF A.</p>"
Dim htmlB = "
<h1>PDF B</h1>
<p>This is the content of PDF B.</p>
<p>This is the first page of PDF B.</p>
<div style='page-break-after: always;'></div>
<p>This is the second page of PDF B.</p>"
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
' Render the HTML content as separate PDF documents
Dim pdfDocA = renderer.RenderHtmlAsPdf(htmlA)
Dim pdfDocB = renderer.RenderHtmlAsPdf(htmlB)
' Merge the two PDFs into one
Dim mergedPdf = PdfDocument.Merge(pdfDocA, pdfDocB)
' Save the merged PDF to a file
mergedPdf.SaveAs("Merged.pdf")Adicionando Marcas d'Água a PDFs
O IronPDF permite adicionar marcas d'água às páginas PDF para branding ou para marcar documentos como confidenciais. A biblioteca gerencia a complexidade de marcas d'água de texto e imagem, proporcionando flexibilidade na aplicação e exibição.
using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
// Render a URL as a PDF
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
// Apply a watermark to the PDF
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);
// Save the watermarked PDF to a file
pdf.SaveAs("Watermarked.pdf");using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
// Render a URL as a PDF
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
// Apply a watermark to the PDF
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);
// Save the watermarked PDF to a file
pdf.SaveAs("Watermarked.pdf");Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate a PDF renderer
Dim renderer As New ChromePdfRenderer()
' Render a URL as a PDF
Dim pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
' Apply a watermark to the PDF
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center)
' Save the watermarked PDF to a file
pdf.SaveAs("Watermarked.pdf")Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate a PDF renderer
Dim renderer As New ChromePdfRenderer()
' Render a URL as a PDF
Dim pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
' Apply a watermark to the PDF
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center)
' Save the watermarked PDF to a file
pdf.SaveAs("Watermarked.pdf")Como Trabalhar com Formulários PDF?
O IronPDF oferece suporte completo ao manuseio de formulários PDF interativos. Você pode criar, preencher e enviar formulários PDF programaticamente, o que é especialmente útil para automatizar o processamento de formulários ou integrar a coleta de dados de formulários aos seus fluxos de trabalho.
using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Define HTML content with form elements
const string formHtml = @"
<html>
<body>
<h2>Employee Information Form</h2>
<form>
First name: <br>
Last name: <br>
<br>
<p>Please select your department:</p>
<select name='department'>
<option value='HR'>HR</option>
<option value='Finance'>Finance</option>
<option value='IT'>IT</option>
<option value='Marketing'>Marketing</option>
</select>
<br>
<br>
<p>Please select your employment status:</p>
<label for='fulltime'>Full-time</label> <br>
<label for='parttime'>Part-time</label> <br>
<br>
<p>Please select your skills:</p>
<label for='skill1'> Programming</label><br>
<label for='skill2'> Design</label><br>
<label for='skill3'> Marketing</label><br>
</form>
</body>
</html>";
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.CreatePdfFormsFromHtml = true;
// Render the HTML form content as a PDF
renderer.RenderHtmlAsPdf(formHtml).SaveAs("EmployeeInfoForm.pdf");using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Define HTML content with form elements
const string formHtml = @"
<html>
<body>
<h2>Employee Information Form</h2>
<form>
First name: <br>
Last name: <br>
<br>
<p>Please select your department:</p>
<select name='department'>
<option value='HR'>HR</option>
<option value='Finance'>Finance</option>
<option value='IT'>IT</option>
<option value='Marketing'>Marketing</option>
</select>
<br>
<br>
<p>Please select your employment status:</p>
<label for='fulltime'>Full-time</label> <br>
<label for='parttime'>Part-time</label> <br>
<br>
<p>Please select your skills:</p>
<label for='skill1'> Programming</label><br>
<label for='skill2'> Design</label><br>
<label for='skill3'> Marketing</label><br>
</form>
</body>
</html>";
// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.CreatePdfFormsFromHtml = true;
// Render the HTML form content as a PDF
renderer.RenderHtmlAsPdf(formHtml).SaveAs("EmployeeInfoForm.pdf");Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Define HTML content with form elements
Const formHtml As String = "
<html>
<body>
<h2>Employee Information Form</h2>
<form>
First name: <br>
Last name: <br>
<br>
<p>Please select your department:</p>
<select name='department'>
<option value='HR'>HR</option>
<option value='Finance'>Finance</option>
<option value='IT'>IT</option>
<option value='Marketing'>Marketing</option>
</select>
<br>
<br>
<p>Please select your employment status:</p>
<label for='fulltime'>Full-time</label> <br>
<label for='parttime'>Part-time</label> <br>
<br>
<p>Please select your skills:</p>
<label for='skill1'> Programming</label><br>
<label for='skill2'> Design</label><br>
<label for='skill3'> Marketing</label><br>
</form>
</body>
</html>"
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
renderer.RenderingOptions.CreatePdfFormsFromHtml = True
' Render the HTML form content as a PDF
renderer.RenderHtmlAsPdf(formHtml).SaveAs("EmployeeInfoForm.pdf")Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Define HTML content with form elements
Const formHtml As String = "
<html>
<body>
<h2>Employee Information Form</h2>
<form>
First name: <br>
Last name: <br>
<br>
<p>Please select your department:</p>
<select name='department'>
<option value='HR'>HR</option>
<option value='Finance'>Finance</option>
<option value='IT'>IT</option>
<option value='Marketing'>Marketing</option>
</select>
<br>
<br>
<p>Please select your employment status:</p>
<label for='fulltime'>Full-time</label> <br>
<label for='parttime'>Part-time</label> <br>
<br>
<p>Please select your skills:</p>
<label for='skill1'> Programming</label><br>
<label for='skill2'> Design</label><br>
<label for='skill3'> Marketing</label><br>
</form>
</body>
</html>"
' Instantiate a PDF renderer
Dim renderer = New ChromePdfRenderer()
renderer.RenderingOptions.CreatePdfFormsFromHtml = True
' Render the HTML form content as a PDF
renderer.RenderHtmlAsPdf(formHtml).SaveAs("EmployeeInfoForm.pdf")
Como Proteger e Criptografar PDFs?
O IronPDF oferece recursos confiáveis para proteger documentos PDF, incluindo criptografia, configurações de permissão e assinaturas digitais. Estes garantem a proteção de informações sensíveis e a manutenção da integridade do documento.
using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Load an existing PDF file
var pdf = PdfDocument.FromFile("invoice.pdf");
// Set document security settings
pdf.SecuritySettings.OwnerPassword = "top-secret"; // Password to edit the PDF
pdf.SecuritySettings.UserPassword = "sharable"; // Password to open the PDF
// Save the secured PDF to a file
pdf.SaveAs("secured.pdf");using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Load an existing PDF file
var pdf = PdfDocument.FromFile("invoice.pdf");
// Set document security settings
pdf.SecuritySettings.OwnerPassword = "top-secret"; // Password to edit the PDF
pdf.SecuritySettings.UserPassword = "sharable"; // Password to open the PDF
// Save the secured PDF to a file
pdf.SaveAs("secured.pdf");Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Load an existing PDF file
Dim pdf = PdfDocument.FromFile("invoice.pdf")
' Set document security settings
pdf.SecuritySettings.OwnerPassword = "top-secret" ' Password to edit the PDF
pdf.SecuritySettings.UserPassword = "sharable" ' Password to open the PDF
' Save the secured PDF to a file
pdf.SaveAs("secured.pdf")Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Load an existing PDF file
Dim pdf = PdfDocument.FromFile("invoice.pdf")
' Set document security settings
pdf.SecuritySettings.OwnerPassword = "top-secret" ' Password to edit the PDF
pdf.SecuritySettings.UserPassword = "sharable" ' Password to open the PDF
' Save the secured PDF to a file
pdf.SaveAs("secured.pdf")
Quais Opções Avançadas de Edição Estão Disponíveis?
IronPDF oferece recursos avançados de edição além das modificações básicas. Isso inclui adicionar cabeçalhos e rodapés, personalizar o layout da página e inserir imagens e fontes. Esses recursos permitem a geração dinâmica de PDFs e personalização para requisitos específicos de aplicações.
using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate a PDF renderer
var renderer = new IronPdf.ChromePdfRenderer();
// Define multi-page HTML content with page breaks
var multiPageHtml = @"
<p> This is 1st Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 2nd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 3rd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 4th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 5th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 6th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 7th Page</p>";
// Render the HTML content as a PDF
var pdfDoc = renderer.RenderHtmlAsPdf(multiPageHtml);
// Create a header for the first page only
var firstPageHeader = new HtmlHeaderFooter();
firstPageHeader.HtmlFragment = "This is the First Page Header";
pdfDoc.AddHtmlHeaders(firstPageHeader, 1);
// Save the resulting PDF with headers to a file
pdfDoc.SaveAs("PagesWithHeaders.pdf");using IronPdf;
// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";
// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate a PDF renderer
var renderer = new IronPdf.ChromePdfRenderer();
// Define multi-page HTML content with page breaks
var multiPageHtml = @"
<p> This is 1st Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 2nd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 3rd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 4th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 5th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 6th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 7th Page</p>";
// Render the HTML content as a PDF
var pdfDoc = renderer.RenderHtmlAsPdf(multiPageHtml);
// Create a header for the first page only
var firstPageHeader = new HtmlHeaderFooter();
firstPageHeader.HtmlFragment = "This is the First Page Header";
pdfDoc.AddHtmlHeaders(firstPageHeader, 1);
// Save the resulting PDF with headers to a file
pdfDoc.SaveAs("PagesWithHeaders.pdf");Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate a PDF renderer
Dim renderer = New IronPdf.ChromePdfRenderer()
' Define multi-page HTML content with page breaks
Dim multiPageHtml = "
<p> This is 1st Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 2nd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 3rd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 4th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 5th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 6th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 7th Page</p>"
' Render the HTML content as a PDF
Dim pdfDoc = renderer.RenderHtmlAsPdf(multiPageHtml)
' Create a header for the first page only
Dim firstPageHeader = New HtmlHeaderFooter()
firstPageHeader.HtmlFragment = "This is the First Page Header"
pdfDoc.AddHtmlHeaders(firstPageHeader, 1)
' Save the resulting PDF with headers to a file
pdfDoc.SaveAs("PagesWithHeaders.pdf")Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
' Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate a PDF renderer
Dim renderer = New IronPdf.ChromePdfRenderer()
' Define multi-page HTML content with page breaks
Dim multiPageHtml = "
<p> This is 1st Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 2nd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 3rd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 4th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 5th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 6th Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 7th Page</p>"
' Render the HTML content as a PDF
Dim pdfDoc = renderer.RenderHtmlAsPdf(multiPageHtml)
' Create a header for the first page only
Dim firstPageHeader = New HtmlHeaderFooter()
firstPageHeader.HtmlFragment = "This is the First Page Header"
pdfDoc.AddHtmlHeaders(firstPageHeader, 1)
' Save the resulting PDF with headers to a file
pdfDoc.SaveAs("PagesWithHeaders.pdf")
Quais Recursos Avançados o Apryse C# Oferece?
Como Adicionar Anotações e Marcação?
Apryse C# permite adicionar anotações e marcações a documentos PDF programaticamente. Isso inclui anotações de texto, destaques, sublinhados e formas – essenciais para processos de revisão de documentos ou para adicionar informações suplementares.
using pdftron;
using pdftron.PDF;
using pdftron.SDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library with your license key
PDFNet.Initialize("License");
// Open an existing PDF document
using (PDFDoc doc = new PDFDoc("input.pdf"))
{
// Access the first page of the document
Page page = doc.GetPage(1);
// Create a text annotation on the document
Text txt = Text.Create(doc, new Rect(10, 20, 30, 40));
txt.SetIcon("UserIcon");
txt.SetContents("It's an annotation!");
page.AnnotPushBack(txt);
// Save the modified document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
}
}
}using pdftron;
using pdftron.PDF;
using pdftron.SDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library with your license key
PDFNet.Initialize("License");
// Open an existing PDF document
using (PDFDoc doc = new PDFDoc("input.pdf"))
{
// Access the first page of the document
Page page = doc.GetPage(1);
// Create a text annotation on the document
Text txt = Text.Create(doc, new Rect(10, 20, 30, 40));
txt.SetIcon("UserIcon");
txt.SetContents("It's an annotation!");
page.AnnotPushBack(txt);
// Save the modified document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
}
}
}Imports pdftron
Imports pdftron.PDF
Imports pdftron.SDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library with your license key
PDFNet.Initialize("License")
' Open an existing PDF document
Using doc As New PDFDoc("input.pdf")
' Access the first page of the document
Dim page As Page = doc.GetPage(1)
' Create a text annotation on the document
Dim txt As Text = Text.Create(doc, New Rect(10, 20, 30, 40))
txt.SetIcon("UserIcon")
txt.SetContents("It's an annotation!")
page.AnnotPushBack(txt)
' Save the modified document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized)
End Using
End Sub
End ClassImports pdftron
Imports pdftron.PDF
Imports pdftron.SDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library with your license key
PDFNet.Initialize("License")
' Open an existing PDF document
Using doc As New PDFDoc("input.pdf")
' Access the first page of the document
Dim page As Page = doc.GetPage(1)
' Create a text annotation on the document
Dim txt As Text = Text.Create(doc, New Rect(10, 20, 30, 40))
txt.SetIcon("UserIcon")
txt.SetContents("It's an annotation!")
page.AnnotPushBack(txt)
' Save the modified document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized)
End Using
End Sub
End Class
Como Converter Documentos para PDF?
Apryse C# permite a conversão de vários formatos de documentos para PDF, incluindo documentos do Office, imagens e HTML. Esse recurso garante formatos de documentos uniformes para arquivamento, compartilhamento ou exibição.
using pdftron;
using pdftron.PDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library
PDFNet.Initialize();
// Create a new PDF document
PDFDoc pdfdoc = new PDFDoc();
// Convert a Word document to PDF and add it to the PDF document
Convert.ToPdf(pdfdoc, "input.docx");
// Save the newly created PDF document
pdfdoc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
}
}using pdftron;
using pdftron.PDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library
PDFNet.Initialize();
// Create a new PDF document
PDFDoc pdfdoc = new PDFDoc();
// Convert a Word document to PDF and add it to the PDF document
Convert.ToPdf(pdfdoc, "input.docx");
// Save the newly created PDF document
pdfdoc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
}
}Imports pdftron
Imports pdftron.PDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library
PDFNet.Initialize()
' Create a new PDF document
Dim pdfdoc As New PDFDoc()
' Convert a Word document to PDF and add it to the PDF document
Convert.ToPdf(pdfdoc, "input.docx")
' Save the newly created PDF document
pdfdoc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized)
End Sub
End ClassImports pdftron
Imports pdftron.PDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library
PDFNet.Initialize()
' Create a new PDF document
Dim pdfdoc As New PDFDoc()
' Convert a Word document to PDF and add it to the PDF document
Convert.ToPdf(pdfdoc, "input.docx")
' Save the newly created PDF document
pdfdoc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized)
End Sub
End ClassComo Extrair Conteúdo de PDFs?
Apryse C# se destaca em extrair texto, imagens e outros conteúdos de documentos PDF. Essa capacidade suporta análise de conteúdo, extração de dados e aplicações de recuperação de informações, permitindo um processamento eficiente do conteúdo de PDFs.
using pdftron;
using pdftron.PDF;
using pdftron.SDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library
PDFNet.Initialize();
// Open an existing PDF document
using (PDFDoc doc = new PDFDoc("input.pdf"))
{
// Iterate through each page of the document
PageIterator itr = doc.GetPageIterator();
for (; itr.HasNext(); itr.Next())
{
Page page = itr.Current();
// Extract text from the page
TextExtractor txt = new TextExtractor();
txt.Begin(page);
// Print the extracted text to the console
Console.WriteLine(txt.GetAsText());
}
}
}
}using pdftron;
using pdftron.PDF;
using pdftron.SDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library
PDFNet.Initialize();
// Open an existing PDF document
using (PDFDoc doc = new PDFDoc("input.pdf"))
{
// Iterate through each page of the document
PageIterator itr = doc.GetPageIterator();
for (; itr.HasNext(); itr.Next())
{
Page page = itr.Current();
// Extract text from the page
TextExtractor txt = new TextExtractor();
txt.Begin(page);
// Print the extracted text to the console
Console.WriteLine(txt.GetAsText());
}
}
}
}Imports pdftron
Imports pdftron.PDF
Imports pdftron.SDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library
PDFNet.Initialize()
' Open an existing PDF document
Using doc As New PDFDoc("input.pdf")
' Iterate through each page of the document
Dim itr As PageIterator = doc.GetPageIterator()
Do While itr.HasNext()
Dim page As Page = itr.Current()
' Extract text from the page
Dim txt As New TextExtractor()
txt.Begin(page)
' Print the extracted text to the console
Console.WriteLine(txt.GetAsText())
itr.Next()
Loop
End Using
End Sub
End ClassImports pdftron
Imports pdftron.PDF
Imports pdftron.SDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library
PDFNet.Initialize()
' Open an existing PDF document
Using doc As New PDFDoc("input.pdf")
' Iterate through each page of the document
Dim itr As PageIterator = doc.GetPageIterator()
Do While itr.HasNext()
Dim page As Page = itr.Current()
' Extract text from the page
Dim txt As New TextExtractor()
txt.Begin(page)
' Print the extracted text to the console
Console.WriteLine(txt.GetAsText())
itr.Next()
Loop
End Using
End Sub
End Class
Como Proteger PDFs com Apryse?
Apryse C# oferece ferramentas completas para proteger documentos PDF. Você pode aplicar proteção por senha, criptografar documentos e gerenciar permissões de usuários para proteger informações sensíveis.
using pdftron;
using pdftron.SDF;
using pdftron.PDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library
PDFNet.Initialize();
// Open an existing PDF document
using (PDFDoc doc = new PDFDoc("input.pdf"))
{
// Initialize the security handler
doc.InitSecurityHandler();
// Create a new security handler
SecurityHandler newHandler = new SecurityHandler();
// Set the user password for the document
newHandler.ChangeUserPassword("new_password");
// Grant permission to print the document
newHandler.SetPermission(SecurityHandler.Permission.e_print, true);
// Apply the security handler to the document
doc.SetSecurityHandler(newHandler);
// Save the secured document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
}
}
}using pdftron;
using pdftron.SDF;
using pdftron.PDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library
PDFNet.Initialize();
// Open an existing PDF document
using (PDFDoc doc = new PDFDoc("input.pdf"))
{
// Initialize the security handler
doc.InitSecurityHandler();
// Create a new security handler
SecurityHandler newHandler = new SecurityHandler();
// Set the user password for the document
newHandler.ChangeUserPassword("new_password");
// Grant permission to print the document
newHandler.SetPermission(SecurityHandler.Permission.e_print, true);
// Apply the security handler to the document
doc.SetSecurityHandler(newHandler);
// Save the secured document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
}
}
}Imports pdftron
Imports pdftron.SDF
Imports pdftron.PDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library
PDFNet.Initialize()
' Open an existing PDF document
Using doc As New PDFDoc("input.pdf")
' Initialize the security handler
doc.InitSecurityHandler()
' Create a new security handler
Dim newHandler As New SecurityHandler()
' Set the user password for the document
newHandler.ChangeUserPassword("new_password")
' Grant permission to print the document
newHandler.SetPermission(SecurityHandler.Permission.e_print, True)
' Apply the security handler to the document
doc.SetSecurityHandler(newHandler)
' Save the secured document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized)
End Using
End Sub
End ClassImports pdftron
Imports pdftron.SDF
Imports pdftron.PDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library
PDFNet.Initialize()
' Open an existing PDF document
Using doc As New PDFDoc("input.pdf")
' Initialize the security handler
doc.InitSecurityHandler()
' Create a new security handler
Dim newHandler As New SecurityHandler()
' Set the user password for the document
newHandler.ChangeUserPassword("new_password")
' Grant permission to print the document
newHandler.SetPermission(SecurityHandler.Permission.e_print, True)
' Apply the security handler to the document
doc.SetSecurityHandler(newHandler)
' Save the secured document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized)
End Using
End Sub
End ClassComo Redigir Informações Sensíveis?
Apryse C# oferece suporte para redigir informações sensíveis de documentos PDF – essencial para questões de conformidade e privacidade. Esse recurso permite a remoção permanente ou ocultação de textos e imagens dentro dos PDFs.
using pdftron;
using pdftron.PDF;
using pdftron.SDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library
PDFNet.Initialize();
// Open an existing PDF document
using (PDFDoc doc = new PDFDoc("input.pdf"))
{
// Define redaction areas on specific pages
Redactor.Redaction[] redactions = {
new Redactor.Redaction(1, new Rect(100, 100, 200, 200), false, "redacted"),
};
// Apply redactions to the document
Redactor.Redact(doc, redactions);
// Save the redacted document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
}
}
}using pdftron;
using pdftron.PDF;
using pdftron.SDF;
class Program
{
static void Main()
{
// Initialize the PDFNet library
PDFNet.Initialize();
// Open an existing PDF document
using (PDFDoc doc = new PDFDoc("input.pdf"))
{
// Define redaction areas on specific pages
Redactor.Redaction[] redactions = {
new Redactor.Redaction(1, new Rect(100, 100, 200, 200), false, "redacted"),
};
// Apply redactions to the document
Redactor.Redact(doc, redactions);
// Save the redacted document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
}
}
}Imports pdftron
Imports pdftron.PDF
Imports pdftron.SDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library
PDFNet.Initialize()
' Open an existing PDF document
Using doc As New PDFDoc("input.pdf")
' Define redaction areas on specific pages
Dim redactions() As Redactor.Redaction = { New Redactor.Redaction(1, New Rect(100, 100, 200, 200), False, "redacted")}
' Apply redactions to the document
Redactor.Redact(doc, redactions)
' Save the redacted document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized)
End Using
End Sub
End ClassImports pdftron
Imports pdftron.PDF
Imports pdftron.SDF
Friend Class Program
Shared Sub Main()
' Initialize the PDFNet library
PDFNet.Initialize()
' Open an existing PDF document
Using doc As New PDFDoc("input.pdf")
' Define redaction areas on specific pages
Dim redactions() As Redactor.Redaction = { New Redactor.Redaction(1, New Rect(100, 100, 200, 200), False, "redacted")}
' Apply redactions to the document
Redactor.Redact(doc, redactions)
' Save the redacted document
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized)
End Using
End Sub
End ClassQuais Documentações e Suporte Estão Disponíveis?
Que Suporte o IronPDF Oferece?
Documentação: IronPDF oferece documentação completa cobrindo tópicos desde guias de primeiros passos até recursos avançados como conversão de HTML para PDF, edição de PDF, mesclagem, divisão e segurança. A documentação fornece conteúdo fácil de seguir com exemplos de código extensos e explicações que orientam você na implementação de várias funcionalidades de PDF.
Suporte: IronPDF oferece assistência por meio de vários canais, incluindo suporte por e-mail, suporte via ticket e chat ao vivo com a equipe de engenharia, onde você pode se conectar com a equipe técnica para questões específicas. Sua aplicação pode se beneficiar imediatamente do sistema de feedback deles.

Que suporte o Apryse C# oferece?
Documentação: Apryse C# (anteriormente PDFTron para .NET) oferece documentação detalhada, incluindo uma referência completa da API, guias para desenvolvedores e exemplos de código para diversas tarefas de manipulação de PDF.
Suporte: Apryse oferece suporte ao desenvolvedor por meio de comunicação direta por e-mail com sua equipe técnica para dúvidas de implementação e resolução de problemas. Você também pode fazer perguntas no Stack Overflow.
Quais são as opções de licença e preços?
Quais são as opções de licença do IronPDF?
O IronPDF oferece várias opções de licenciamento adaptadas às diferentes necessidades de projetos. Os preços começam em $999 para uma licença Lite. Essas licenças variam conforme o número de desenvolvedores, locais e projetos cobertos. O IronPDF também oferece opções de redistribuição livre de royalties e suporte estendido com preços específicos para complementos.
As opções de licença perpétua do IronPDF incluem:
- Lite Edition: Custa $999, adequada para 1 desenvolvedor, 1 local e 1 projeto, com suporte por e-mail incluso.
- Plus Edition: Com preço de $1,499, cobre até 3 desenvolvedores, 3 locais e 3 projetos, com suporte por e-mail e chat 24 horas, além de suporte por telefone.
- Professional Edition: Por $2,999, esta edição é para até 10 desenvolvedores, 10 locais e 10 projetos, oferecendo suporte abrangente incluindo e-mail, chat, telefone e compartilhamento de tela.
Eles também oferecem uma assinatura mensal de $500 incluindo 10.000 chamadas de API, com chamadas adicionais a $0,02 cada. Para uso ilimitado, o IronPDF disponibiliza uma solução empresarial com preço sob consulta. Esta solução inclui licenciamento perpétuo ilimitado e chamadas de API, entre outros recursos.
Quais são as opções de licença do Apryse C#?
O Apryse C# oferece preços personalizáveis com base nos requisitos específicos do projeto, incluindo recursos, volume de documentos e cenários de implantação. É necessário entrar em contato com a equipe de vendas para obter informações sobre preços do Apryse.

Qual biblioteca PDF devo escolher?
Tanto o IronPDF quanto o Apryse C# oferecem capacidades eficazes para desenvolvedores .NET que trabalham com PDFs. O IronPDF se destaca com recursos extensos de manipulação de PDF. Ele se sobressai com capacidades completas, incluindo edição avançada e mesclagem de PDFs usando IronPDF. O pacote Iron Suite oferece acesso a várias ferramentas por um preço acessível, equipando seu desenvolvimento com utilitários confiáveis para diversas necessidades.
O IronPDF se destaca por sua versatilidade geral e proposta de valor na maioria dos cenários de processamento de PDF. Sua decisão final deve estar alinhada com os requisitos do seu projeto e os recursos específicos necessários para o seu desenvolvimento.
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 bem estruturados e visualmente atraentes.
Artigos Relacionados

Relatar um problema