Embedding font - existing pdf

Hi,
I have a question:
I need to embed fonts in an existing pdf.

If I use:

Font fnt = new Font("c:\\Arial.ttf", 12f);
PdfFont font = new PdfTrueTypeFont( fnet, true);
page.Graphics.DrawString("Embedded font", font, brush, 0,100);

I can embed fonts in a new pdf, but for an existing one?
tnx.

9 Replies

AG Angappan G Syncfusion Team May 3, 2010 12:04 PM UTC

Hi Barbara,

Thank you for your interest in Essential Pdf.

We can embed the fonts into an existing pdf file using the following code snippet

PdfLoadedDocument ldoc = new PdfLoadedDocument("../Data/Fonts.pdf");

PdfFont font = new PdfTrueTypeFont("../Data/CENTURY.TTF", 12f);

PdfLoadedPage lpage = ldoc.Pages[0] as PdfLoadedPage;

lpage.Graphics.DrawString("Embedded Font", font, brush,location);

Please try this and let us know if you have any queries.

Regards,
Angappan.


BT Barbara Tacchino May 6, 2010 10:16 AM UTC

Ok, but in this way I can add an embedded font.
I've an existing pdf with standard fonts (no embedded) and I need replace every font with the embedded one.
Can you help me?


AG Angappan G Syncfusion Team May 7, 2010 09:50 AM UTC

Hi Barbara

It is not possible to replace the existing fonts with the embedded fonts because "Fonts" are XObjects in PDF.To embed the new fonts, the existing standard font entries must be deleted,but it is not possible to delete the Xobjects in the PDF once they were added.

Please let us know if you have any queries.

Regards,
Angappan.


BS Brent Snyder February 8, 2013 04:37 PM UTC

Just wondering if you had any future plans on this topic?  Aspose, does allow to cycle through fonts that are not embedded and set a property to embed them.

Brent


GL George Livingston Syncfusion Team February 14, 2013 10:27 AM UTC

Hi Brent,

Thank you for your update.

This feature request for “Need to add support to embed the non-embedded font in the PDF Document” has been added. We will let you know once the feature has been implemented.

Please let us know if you have any questions.

Regards,
George



MB Mike Burgess January 2, 2014 04:00 PM UTC

Has this ever been added? or is there some code that will find the list of fonts in the PDF so that they can then be added?


PH Praveenkumar H Syncfusion Team January 7, 2014 03:41 AM UTC

Hi Mike,

Thank you for your interest in Syncfusion products,

Still feature request  “Need to add support to embed the non-embedded font in the PDF Document” is not implemented. We will let you know once the feature has been implemented.

Please let us know if you have any questions.

Regards,
Praveen


DI Dimitri December 4, 2025 05:11 AM UTC

Hi,

Has this feature has been added now?

We can add an extra text with custom font in the existing pdf file, but can we change the font in the existing pdf file?

We have pdf files where the content is not readable as can be found in the attachment. It looks like the pdf file does not have fonts embedded in it.

Is it possible to attach the web fonts in

Thanks


Attachment: image_4_f0f02047.png


IJ Irfana Jaffer Sadhik Syncfusion Team December 5, 2025 12:25 PM UTC

Hi Dimitri,


Yes,you can embed all the non-embedded fonts in an existing PDF document using the EmbedFonts method provided by Syncfusion. This ensures that the text becomes readable by embedding the required fonts into the PDF.

This approach will embed the missing fonts into the PDF, making the content readable. However, note that this does not change the existing font style; it only ensures the original fonts are properly embedded.

Follow the link below for more information:

Embed all the non-embedded fonts in the existing PDF document


Regards,

Irfana J.



Loader.
Up arrow icon