zoukankan      html  css  js  c++  java
  • Devexpress PdfViewer预览pdf,禁止下载,打印,复制

    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();
  • 相关阅读:
    compass 制作css sprites
    net模块
    javascript -- 代理模式
    javascript -- 单例模式
    js 对象的浅拷贝和深拷贝
    js 对象的封装,继承,多态的理解
    this,call,apply
    flex 实现圣杯布局
    ubuntu中安装mongodb
    devDependencies和dependencies的区别
  • 原文地址:https://www.cnblogs.com/william-CuiCui0705/p/8571567.html
Copyright © 2011-2022 走看看