Fontes no IronPDF: Melhores Práticas
O IronPDF incorpora fontes?
Todas as fontes (ou subconjuntos delas) usadas no seu HTML são incorporadas automaticamente no PDF, desde que a propriedade "Incorporar fonte" esteja definida como "Editável". Isso garante que o PDF seja exibido com as mesmas fontes, evitando quaisquer discrepâncias.
O IronPDF consegue remover fontes?
Sim, o IronPDF pode remover fontes. Tecnicamente, isso é conseguido desincorporando a fonte. Para instruções mais detalhadas sobre como gerenciar e remover fontes embutidas de PDFs, por favor visite o seguinte artigo de instruções: 'Como Gerenciar Fontes em PDF'
// Example of code to unembed fonts from a PDF using IronPDF
using IronPdf;
// Load the existing PDF document
var pdf = PdfDocument.FromFile("existing-document.pdf");
// Remove fonts by unembedding them
foreach (var font in pdf.Fonts)
{
font.Unembed();
}
// Save the updated PDF document
pdf.SaveAs("document-without-embedded-fonts.pdf");' Example of code to unembed fonts from a PDF using IronPDF
Imports IronPdf
' Load the existing PDF document
Dim pdf = PdfDocument.FromFile("existing-document.pdf")
' Remove fonts by unembedding them
For Each font In pdf.Fonts
font.Unembed()
Next
' Save the updated PDF document
pdf.SaveAs("document-without-embedded-fonts.pdf")' Example of code to unembed fonts from a PDF using IronPDF
Imports IronPdf
' Load the existing PDF document
Dim pdf = PdfDocument.FromFile("existing-document.pdf")
' Remove fonts by unembedding them
For Each font In pdf.Fonts
font.Unembed()
Next
' Save the updated PDF document
pdf.SaveAs("document-without-embedded-fonts.pdf")Posso incorporar uma fonte inteira no meu PDF?
Sim, o IronPDF permite incorporar fontes em seus documentos PDF. A incorporação de fontes garante consistência visual, pois o documento será exibido com as fontes desejadas, independentemente de estarem instaladas no sistema do visualizador. Observe que a incorporação de fontes pode aumentar o tamanho do arquivo PDF. Para instruções mais detalhadas sobre como gerenciar e embutir fontes em PDFs, visite o artigo de instruções: 'Como Gerenciar Fontes em PDF'
// Example of code to embed fonts in a PDF using IronPDF
using IronPdf;
// Create a new PdfDocument or load an existing one
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
// Embed a font into the document, then save
pdf.Fonts.Add(File.ReadAllBytes("MyFont.ttf")).Embed();
pdf.SaveAs("document-with-embedded-fonts.pdf");// Example of code to embed fonts in a PDF using IronPDF
using IronPdf;
// Create a new PdfDocument or load an existing one
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
// Embed a font into the document, then save
pdf.Fonts.Add(File.ReadAllBytes("MyFont.ttf")).Embed();
pdf.SaveAs("document-with-embedded-fonts.pdf");' Example of code to embed fonts in a PDF using IronPDF
Imports IronPdf
' Create a new PdfDocument or load an existing one
Dim renderer = New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")
' Embed a font into the document, then save
pdf.Fonts.Add(File.ReadAllBytes("MyFont.ttf")).Embed()
pdf.SaveAs("document-with-embedded-fonts.pdf")' Example of code to embed fonts in a PDF using IronPDF
Imports IronPdf
' Create a new PdfDocument or load an existing one
Dim renderer = New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")
' Embed a font into the document, then save
pdf.Fonts.Add(File.ReadAllBytes("MyFont.ttf")).Embed()
pdf.SaveAs("document-with-embedded-fonts.pdf")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.