Subset fonts

On this page

Optimization resources. SubsetFonts optimization option Fonts will be converted into subsets if set to true

If the file uses embedded fonts, it contains all font data. GroupDocs.Viewer can subset embedded fonts to reduce the file size.

To subset fonts in a PDF file, set the SubsetFonts property to true.

The following code snippet shows how to subset fonts in a PDF file:

using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
using GroupDocs.Viewer.Domain.Documents.PostProcessing.Pdf.Optimization;
// ...

using (var viewer = new Viewer("sample.docx"))
{
    PdfViewOptions viewOptions = new PdfViewOptions();
    viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions()
    {
        SubsetFonts = true
    };
     
    viewer.View(viewOptions);
}

The following image demonstrates the result. There is no difference in appearance:

No difference in appearance

But there is the significant difference in size:

Significant difference in size

On this page