IronPDF 中的字體:最佳實踐
This article was translated from English: Does it need improvement?
TranslatedView the article in English
IronPDF是否嵌入字體?
假設字體的 Font embed 屬性設定為 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");$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 剛剛發布






