Subset fonts
Leave feedback
On this page
Not optimized files may contain embedded fonts. GroupDocs.Viewer can remove unused instructions in embedded fonts to reduce the file size.
To subset fonts in a PDF file, set the subset_fonts property to True
.
The following code snippet shows how to subset fonts in a PDF file:
with gv.Viewer("sample.docx") as viewer:
viewOptions = gvo.PdfViewOptions()
viewOptions.pdf_optimization_options = gvo.PdfOptimizationOptions()
viewOptions.pdf_optimization_options.subset_fonts = True
viewer.view(viewOptions)
The following image demonstrates the result. There is no difference in appearance:
But there is the significant difference in size:
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.