private void MainForm_Load(object sender, EventArgs e) { string tmpDir = Path.GetDirectoryName(Application.ExecutablePath) + "\\tmp"; mdi = new MODIHandler(invisDocView, tmpDir); batchUI = new BatchUI(invisDocView, tmpDir); // set up batch UI batchUI.Visible = false; batchUI.Parent = this; batchUI.Top = pageList.Top; batchUI.Left = pageList.Left; batchUI.Height = pageList.Height; batchUI.Width = MODIContainer.Right - pageList.Left; batchUI.SetBg(pageList.BackColor); batchUI.SetDir(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); batchUI.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right); // init zoom level, set to pan mode docView.SetScale(zoom, zoom); docView.ActionState = MODI.MiActionState.miASTATE_PAN; // changing container's bg color seems to change the MODI control's MODIContainer.BackColor = pageList.BackColor; // resize to trigger MODI's resize Size = new Size(900, 600); // build save filetypes saveFileDialog.Filter = string.Join("|", saveFilters); // MDI as arg[1] if (autoOpen.Length > 0) Open(autoOpen); // for testing //Open("E:\\projects\\mdiconv\\samples\\example.MDI"); //Open("E:\\projects\\mdiconv\\samples\\Total control under MDI.mdi"); }
public BatchUI(AxMODI.AxMiDocView mdiView, string tmpDir) { InitializeComponent(); mdi = new MODIHandler(mdiView, tmpDir); }
// OCR private static void DoOCR(MODIHandler hand, WaitForm wait) { /* wait.Status = "Running OCR..."; try { // process all pages //hand.doc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH); // process one by one to show progress int page = 1; foreach (MODI.IImage iimg in hand.doc.Images) { wait.Status = "Running OCR on page " + page.ToString() + "..."; iimg.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH); page++; } hand.isOCRDone = true; } catch { hand.isOCRDone = false; }*/ hand.isOCRDone = true; wait.CloseSafe(); }