/// <summary> /// Method to verify the common parameters that are sent with every request to the service. This method also double checks to make sure that the LEADTOOLS license is set appropriately. /// </summary> internal bool VerifyCommonParameters(LeadWebRequest request) { try { if (request == null) { throw new Exception(); } //Passing a last page value of -1 indicates that we want to process every page in the file. if ((request.FirstPage > request.LastPage && request.LastPage != -1) || request.FirstPage < 1) { throw new Exception(); } if (!DemoConfiguration.UnlockSupport()) { throw new RasterException("Your license file is missing, invalid or expired. LEADTOOLS will not function. Please contact LEAD Sales for information on obtaining a valid license"); } return(true); } catch (RasterException) { throw; } catch { return(false); } }
/// <summary> /// Method to create and initialize the LEAD OCR engine. /// </summary> static internal IOcrEngine InitEngine() { DemoConfiguration.UnlockSupport(); IOcrEngine engine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, false); if (string.IsNullOrWhiteSpace(DemoConfiguration.OCREnginePath)) { engine.Startup(null, null, null, null); } else { engine.Startup(null, null, null, DemoConfiguration.OCREnginePath); } return(engine); }