【问题标题】:Trying to open and Read PDF file in c# in uwp尝试在 uwp 中用 c# 打开和读取 PDF 文件
【发布时间】:2017-08-21 14:21:29
【问题描述】:

在 UWP 中,文件正在使用文件选择器打开并存储到存储文件中。并且可以转换成 PdfDocument。如果pdf文件正常就好了。但它不适用于受密码保护的 PDF 文档。如何询问用户、PDF的密码并安全打开。

谢谢。

【问题讨论】:

    标签: c# pdf c#-4.0 uwp uwp-xaml


    【解决方案1】:

    PdfDocument 包含 IsPasswordProtected 属性:

    如果可移植文档格式 (PDF) 文档受密码保护,则为真;否则为假。

    所以获取这个属性如果为真,需要密码才能安全打开PDF。

    if (pdfDocument.IsPasswordProtected)
    {
        rootPage.NotifyUser("Document is password protected.", NotifyType.StatusMessage);
    }
    else
    {
        rootPage.NotifyUser("Document is not password protected.", NotifyType.StatusMessage);
    }
    

    更多详情请参考official sample

    【讨论】:

      猜你喜欢
      • 2013-04-25
      • 2021-02-10
      • 1970-01-01
      • 1970-01-01
      • 2012-03-06
      • 2017-02-07
      • 1970-01-01
      • 1970-01-01
      • 2015-07-09
      相关资源
      最近更新 更多