IronPDF 中的字型:最佳實務
This article was translated from English: Does it need improvement?
Translated
View 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");
' 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 下載 19,014,616 | 版本: 2026.5 just released

