Czcionki w IronPDF: najlepsze praktyki
Czy IronPDF osadza czcionki?
Wszystkie czcionki (podzbiory) używane wewnątrz Twojego HTML są automatycznie osadzane w PDF, zakładając, że właściwość osadzania czcionki jest ustawiona na Edytowalne. To zapewnia, że PDF jest wyświetlany z tymi samymi czcionkami, zapobiegając wszelkim niezgodnościom.
Czy IronPDF może usunąć czcionki?
Tak, IronPDF może usunąć czcionki. Technicznie osiąga to poprzez odosadzanie czcionki. Aby uzyskać bardziej szczegółowe instrukcje dotyczące zarządzania czcionkami i ich usuwania z osadzania w PDF, proszę odwiedzić poniższy artykuł typu How-to: 'How to Manage Fonts in 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")Czy mogę osadzić całą czcionkę w moim PDF?
Tak, IronPDF pozwala osadzać czcionki w dokumentach PDF. Osadzanie czcionek zapewnia spójność wizualną, ponieważ dokument będzie wyświetlany z oczekiwanymi czcionkami, niezależnie od tego, czy są zainstalowane na systemie przeglądającego. Zauważ, że osadzanie czcionek może zwiększyć rozmiar pliku PDF. Aby uzyskać bardziej szczegółowe instrukcje dotyczące zarządzania czcionkami i ich osadzania w PDF, odwiedź artykuł typu How-to: 'How to Manage Fonts in 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 posiada tytuł licencjata z informatyki (Uniwersytet Carleton) i specjalizuje się w front-endowym rozwoju, z ekspertką w Node.js, TypeScript, JavaScript i React. Pasjonuje się tworzeniem intuicyjnych i estetycznie przyjemnych interfejsów użytkownika, Curtis cieszy się pracą z nowoczesnymi frameworkami i tworzeniem dobrze zorganizowanych, atrakcyjnych wizualnie podręczników.