IronPDF中的字體:最佳實踐
This article was translated from English: Does it need improvement?
Translated
View the article in English
IronPDF會嵌入字體嗎?
假設字體的嵌入屬性設置為Editable,則使用在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");
' Example of code to unembed fonts from a PDF using IronPDF
Imports IronPdf
' Load the existing PDF document
Private 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
});
' Example of code to embed fonts in a PDF using IronPDF
Imports IronPdf
' Create a new PdfDocument or load an existing one
Private pdf = (New IronPdf.HtmlToPdf()).RenderHtmlAsPdf("<h1>Hello World</h1>")
' Ensure all fonts are embedded
pdf.SaveAs("document-with-embedded-fonts.pdf", New PdfSaveOptions With {.EmbedFonts.Enabled = True})
$vbLabelText
$csharpLabel
準備開始了嗎?
Nuget 下載 20,296,129 | 版本: 2026.7 剛剛發布

