PdfFont.FixEncoding Method

Fixes PDF font encoding if possible.

Namespace:  BitMiracle.Docotic.Pdf
Assembly:  BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)

Syntax

C#
public bool FixEncoding()
VB
Public Function FixEncoding As Boolean

Return Value

Type: Boolean
true if font encoding was updated; otherwise, false.

Remarks

Some PDF generators produce PDF documents with broken font encodings. Extraction of text from such documents is not possible.

This method tries to fix font encoding in the PDF document. It reads information about encoding in the font bytes and updates PDF encoding correspondingly.

This method might fail to fix encoding in the following cases:

  • Font is not embedded. For such fonts the Embedded property is false.
  • Font bytes do not contain information about encoding.
  • Font is of an unsupported type. For now, only Type0 fonts are supported.

See Also