コード例 #1
0
        private static 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());
                }
            }
        }
コード例 #2
0
        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);
            }
        }