PDFviewer控件:

参数设置:

1、屏蔽书签栏和右键菜单

2、加载文档支持路径以及流stream加载的方式

1 pdfViewer.MenuManager.DisposeManager();
2 pdfViewer.NavigationPaneVisibility=DevExpress.XtraPdfViewer.PdfNavigationPaneVisibility.Hidden;
3 pdfViewer.NavigationPaneInitialVisibility=DevExpress.XtraPdfViewer.PdfNavigationPaneVisibility.Hidden;
4 pdfViewer.DetachStreamAfterLoadComplete = false;//加载完文档后关闭流
加载文档的方式:
    1、pdfViewer.LoadDocument(ms);//支持流Stream(FileStream)
    2、pdfViewer.DocumentFilePath = path;//文件所在路径path

文件保存路径对话框:

            var fbDialog = new FolderBrowserDialog();
            if (fbDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var folderPath = fbDialog.SelectedPath;    

       KingMessageBox.ShowMessage($"下载完成!");
            Process.Start("explorer.exe", folderPath);//文件保存完毕后,显示文件所在的目录

pdf文件下载:

pdfViewer1.SaveDocument(流的形式);

pdf打印:

this.pdfViewer.Print();

 

相关文章:

  • 2021-08-09
  • 2022-12-23
  • 2021-10-02
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2021-10-13
  • 2021-07-14
  • 2022-02-20
相关资源
相似解决方案