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(); } }