Table of Contents

Method Unembed

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

Unembed()

Removes font bytes from the PDF file.

public bool Unembed()

Returns

bool

true if font bytes were successfully removed; otherwise, false.

Remarks

This method might fail to remove font bytes in the following cases:

  • The font is not embedded. For such fonts the Embedded property is false.
  • The font is used by one of form controls (PdfTextBox, PdfComboBox, etc.) and therefore can't be unembedded. A PDF reader might be unable to view or change text in a control if the control uses an unembedded font.
  • The font is a Type3 font. Type3 fonts cannot be unembedded by its nature.
  • PDF readers will not be able to load the font after unembedding.

It is not recommended to remove any font bytes if you plan to save the current document as a PDF/A document. PDF/A documents should have all used fonts embedded. Therefore, the library will try to embed all font bytes before producing a PDF/A.

Some PDF documents use a same font descriptor and font bytes in multiple fonts. In such cases, the call of this method for first font will also remove font bytes for all other fonts.