private void SaveDocument(string documentFileName) { // Update the characters from what we have so far // The word is remove now from the OCR results _ocrPage.SetRecognizedCharacters(_ocrPageCharacters); // Save this document as PDF // Setup the arguments for the callback Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("documentFileName", documentFileName); args.Add("viewDocument", _preferencesViewSavedDocumentToolStripMenuItem.Checked); // Call the process dialog try { bool allowProgress = _preferencesUseCallbacksToolStripMenuItem.Checked; using (OcrProgressDialog dlg = new OcrProgressDialog(allowProgress, "Saving Document", new OcrProgressDialog.ProcessDelegate(DoSaveDocument), args)) { dlg.ShowDialog(this); } } catch (Exception ex) { ShowError(ex); } finally { UpdateUIState(); } }
private void OpenDocument(string documentFileName) { // Create a new document, add the page to it and recognize it // If all the above is OK, then use it // Setup the arguments for the callback Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("documentFileName", documentFileName); // Call the process dialog try { bool allowProgress = _preferencesUseCallbacksToolStripMenuItem.Checked; using (OcrProgressDialog dlg = new OcrProgressDialog(allowProgress, "Loading and Recognizing Document", new OcrProgressDialog.ProcessDelegate(DoLoadAndRecognizeDocument), args)) { dlg.ShowDialog(this); } } catch (Exception ex) { ShowError(ex); } finally { UpdateUIState(); } }