How to Specify How Fonts are Embedded in Adobe PDF Format

Skip to end of metadata
Go to start of metadata
This page is no longer maintained. For an updated page, please visit Rendering.
Fonts need to be embedded into any Adobe PDF document to ensure the document can be correctly read on any machine.

By default, Aspose.Words embeds a subsets of fonts used in the document into the generated PDF. This means only the glyphs (characters) that were used in the document being rendered are actually saved to the PDF.

When to Use Full Fonts and when to Subset?

There is a way to specify Aspose.Words to embed full fonts. Further details, along with the advantages and disadvantages of each setting is described in the table below.

Embed Fonts Mode Advantages Disadvantages
Full
  • Useful when you want to edit the resulting PDF later by adding or modifying the text. All fonts are included so there are therefore all glyphs are present.
  • Some fonts are large (several megabytes) and embedding them without subsetting can result in large output documents.
Subset
  • Subsetting is useful if you want to keep the output file size smaller
  • The user cannot fully add or edit text using the subsetted font in the output PDF document. This is because not all glyphs of the font are present.
  • If multiple PDFs are saved with subsetted fonts and assembled together then the combined PDF document may contain a single font represented by many unnecessary subsets.

The Solution

The PdfSaveOptions.EmbedFullFonts property is provided to specify how Aspose.Words embeds fonts into an output PDF document.

  • Set PdfSaveOptions.EmbedFullFonts to true to embed full fonts into the output PDF document.
  • Set PdfSaveOptions.EmbedFullFonts to false to subset fonts when saving to PDF.

The Code

The code below demonstrates how to create a new instance of the PdfSaveOptions class and specify the EmbedFullFonts property to control how fonts are embedded. Both examples of full font embedding and subsetting are provided.

Example
Demonstrates how to set Aspose.Words to embed full fonts in the output PDF document.


Example
Demonstrates how to set Aspose.Words to subset fonts in the output PDF.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.