Unplanned
Last Updated: 18 Jul 2023 13:13 by ADMIN
Leron
Created on: 12 Jul 2023 13:58
Category: WordsProcessing
Type: Bug Report
5
WordsProcessing: PdfFormatProvider: Implement a setting that allows to choose if the fonts should be embedded in the document

Is there a way to prevent font embedding in the RadFlow methodology or is utilizing RadFixed the only way to have a reasonably sized PDF document?

1 comment
ADMIN
Yoan
Posted on: 18 Jul 2023 13:13

Hi Leron,

The automatic embedding of fonts happens by default only in the .NET Framework environment and embeds just the fonts used in the document. 

If you prefer to skip the fonts embedding then I can suggest referencing .NET Standard assemblies in your project instead. If you decide to do that you should keep in mind that there are some limitations you need to be aware of when working in that environment. I am sending you a few links from our documentation that describe the mentioned limitations, how they take form, and how to avoid them:

Another approach I can offer you is to import and export the result PDF file with the PdfProcesisng library while having the PdfFormatProvider's ShouldEmbedFonts property set to false in order to remove all fonts embedded in it:

RadFixedDocument document;
PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();

using (Stream input = File.OpenRead("input.pdf"))
{
    document = pdfFormatProvider.Import(input);
}

pdfFormatProvider.ExportSettings.ShouldEmbedFonts= false;

using (Stream output = File.OpenWrite("output.pdf"))
{
    pdfFormatProvider.Export(document, output);
}

A similar setting like the ShouldEmbedFonts is not available in the PdfFormatProvider for WordsProcessing, which is why I have logged a task about that in our Feedback Portal on our behalf - WordsProcessing: PdfFormatProvider: Implement a setting that allows to choose if the fonts should be embedded in the document. If you are interested feel free to cast your vote for it, subscribe to track its progress, and leave a comment if you see fit.

I have also updated your Telerik Points as a sign of appreciation for bringing this to our attention.

Also, please feel free to correct me if I am misunderstanding the scenario you are describing so we can proceed on resolving the case.

If you have any further questions, feel free to ask.

Regards,
Yoan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.