private void OpenPdf(AxFoxitPDFSDK foxit, string DocumentPath) { if (foxit != null) { foxit.UnLockActiveX(C.LICENCE_ID, C.UNLOCK_CODE); foxit.ShowTitleBar(false); foxit.ShowToolBar(false); foxit.ShowNavigationPanels(true); foxit.SetShowSavePrompt(false, 0); foxit.CurrentTool = C.TEXT_TOOL; } if (foxit != null) { try { if (!foxit.OpenFile(DocumentPath, null)) { AppErrorBox.ShowErrorMessage("Can't open pdf file", "Can't open pdf file"); } foxit.CurrentTool = C.TEXT_TOOL; foxit.RemoveEvaluationMark(); } catch (Exception ex) { Log.This(ex); AppErrorBox.ShowErrorMessage("Unable to Open PDF", ex.ToString()); } } }
private void CopyMenuItem_Click(object sender, RoutedEventArgs e) { var responses = (DataContext as QueryWindowVM).Responses; if (responses != null) { string html = HtmlUtils.EnumerableToHtmlTable(responses, r => r.Response, r => r.User, r => r.Timestamp); string fileName = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".xls"; try { File.WriteAllText(fileName, html); Process.Start(fileName); } catch (Exception ex) { AppErrorBox.ShowErrorMessage("Error while generating excel . .", ex.ToString()); } } }
private void ReactionsList_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { string DocumentPath; if (ReactionsList.SelectedValue != null) { DocumentPath = Path.Combine(C.UserManualsPath, (ReactionsList.SelectedValue as UserManualVM).Value); if (File.Exists(DocumentPath)) { AxFoxitPDFSDK foxit = UserPdfHost.Child as AxFoxitPDFSDK; if (foxit != null) { foxit.UnLockActiveX(C.LICENCE_ID, C.UNLOCK_CODE); foxit.ShowTitleBar(false); foxit.ShowToolBar(false); foxit.ShowNavigationPanels(true); foxit.SetShowSavePrompt(false, 0); } if (foxit != null) { if (!foxit.OpenFile(DocumentPath, String.Empty)) { AppErrorBox.ShowErrorMessage("Can't open pdf file", "Can't open pdf file"); } } } else { AppInfoBox.ShowInfoMessage("PDF File not Found. Please Try after some time."); } } } catch (Exception ex) { Log.This(ex); } }