Esempio n. 1
0
        //[Newtonsoft.Json.JsonIgnore]
        //public float Image2PdfResolutionRatio { get; private set; }

        protected override void Loaded()
        {
            Pdf2ImageResolutionRatio = (float)PdfResolution / PdfPageImageResolution;
            //Image2PdfResolutionRatio = (float)PdfPageImageResolution / PdfResolution;

            if (OcrConfig == null)
            {
                OcrConfig = new Ocr.Config
                {
                    Language            = "eng",
                    EngineMode          = Tesseract.EngineMode.Default,
                    VariableNames2value = new Dictionary <string, object>
                    {
                        { "load_system_dawg", false },  //don't load dictionary
                        { "load_freq_dawg", false },    //don't load dictionary
                        //(name: "tessedit_char_whitelist", "0123456789.,"),
                    }
                }
            }
            ;
        }
Esempio n. 2
0
 /// <summary>
 /// First it must be called before any use of the PdfDocumentParser.
 /// Then it can be called to re-initialize.
 /// </summary>
 /// <param name="ocrConfig"></param>
 public static void Initialize(Ocr.Config ocrConfig)//trigger Program()
 {
     Ocr.DisposeThis();
     Settings.Constants.OcrConfig = ocrConfig;
 }