Skip to content
English
  • There are no suggestions because the search field is empty.

IronOCR How to Fix Garbled Gujarati Text for Searchable PDF Output

Overview

When you OCR a Gujarati document with IronOCR and save it as a searchable PDF, the recognized text can look correct on screen but turn into garbled characters when you copy or extract it. This article shows you how to fix that by saving the PDF with a font that supports Gujarati.

Prerequisites

  • IronOCR with the Gujarati language pack (OcrLanguage.GujaratiBest)
  • A Gujarati-compatible TrueType font on the machine, such as AnekGujarati (freely available from Google Fonts)
  • The full file path to that font

Steps

  1. Place a Gujarati-compatible font file on the machine and note its full path. For example:
    C:\Path\To\AnekGujarati-VariableFont_wdth,wght.ttf
  2. When saving the searchable PDF, pass the font path and the language name to SaveAsSearchablePdf():
    ocrResult.SaveAsSearchablePdf(       
    strOutputFile,       
    false,       
    @"C:\Path\To\AnekGujarati-VariableFont_wdth,wght.ttf",       
    "Gujarati");

     

  3. Replace the font path with the actual location of the Gujarati font file on your machine.
  4. Open the generated PDF and copy the Gujarati text to confirm it now extracts correctly.

Notes and Limitations

  • The font used by the searchable PDF must contain Gujarati glyphs. If it does not, the recognized text has no matching characters to map to, which is why copied text comes out garbled even when OCR reads the page correctly.
  • A Latin-only font will not fix this. The font you supply has to support the Gujarati script.
  • The path must point to the exact font file. The AnekGujarati variable-font filename contains a comma (AnekGujarati-VariableFont_wdth,wght.ttf), so copy it precisely.
  • This same approach applies to other non-Latin scripts. If a copied or extracted layer is garbled, supply a font that supports that script.
  • If the copied text still appears garbled after this change, confirm the supplied font genuinely includes Gujarati glyphs.