IronPDF 中的字体:最佳实践
This article was translated from English: Does it need improvement?
TranslatedView the article in English
IronPDF会嵌入字体吗?
假设字体的嵌入属性设置为可编辑,所有在您的HTML中使用的字体(子集)都会自动嵌入到PDF中。 这确保了PDF以相同的字体显示,防止任何不一致。
IronPDF可以移除字体吗?
是的,IronPDF可以移除字体。 技术上,它通过取消嵌入字体实现这一点。 有关如何管理和取消嵌入PDF中字体的更详细说明,请访问以下操作指南文章:'如何管理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
pdf.UnembedAllFonts();
// Save the updated PDF document
pdf.SaveAs("document-without-embedded-fonts.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
pdf.UnembedAllFonts();
// Save the updated PDF document
pdf.SaveAs("document-without-embedded-fonts.pdf");$vbLabelText $csharpLabel
我可以在我的PDF中嵌入整个字体吗?
是的,IronPDF允许您在PDF文档中嵌入字体。 嵌入字体确保视觉一致性,因为无论查看者的系统上是否安装了所需字体,文档都将以所需字体显示。 请注意,嵌入字体可能会增加PDF的文件大小。 有关如何管理和嵌入PDF中字体的更详细说明,请访问操作指南文章:'如何管理PDF中的字体'
// Example of code to embed fonts in a PDF using IronPDF
using IronPdf;
// Create a new PdfDocument or load an existing one
var pdf = new IronPdf.HtmlToPdf().RenderHtmlAsPdf("<h1>Hello World</h1>");
// Ensure all fonts are embedded
pdf.SaveAs("document-with-embedded-fonts.pdf", new PdfSaveOptions
{
EmbedFonts.Enabled = true
});// Example of code to embed fonts in a PDF using IronPDF
using IronPdf;
// Create a new PdfDocument or load an existing one
var pdf = new IronPdf.HtmlToPdf().RenderHtmlAsPdf("<h1>Hello World</h1>");
// Ensure all fonts are embedded
pdf.SaveAs("document-with-embedded-fonts.pdf", new PdfSaveOptions
{
EmbedFonts.Enabled = true
});$vbLabelText $csharpLabel
准备开始了吗?
Nuget 下载 17,012,929 | 版本: 2025.12 刚刚发布






