[英]Trying to open and Read PDF file in c# in uwp
在UWP中,文件将使用文件选择器打开并存储到存储文件中。 并且可以将其转换为PdfDocument。 如果pdf文件正常,那将会很好。 但是,对于受密码保护的PDF文档而言,效果并不理想。 如何询问用户,PDF的密码并安全打开。
谢谢。
PdfDocument
包含IsPasswordProtected
属性:
如果可移植文档格式(PDF)文档受密码保护,则为true;否则为true。 否则为假。
因此,如果此属性为true,请获取安全打开PDF所需的密码。
if (pdfDocument.IsPasswordProtected)
{
rootPage.NotifyUser("Document is password protected.", NotifyType.StatusMessage);
}
else
{
rootPage.NotifyUser("Document is not password protected.", NotifyType.StatusMessage);
}
更多细节请参考官方样品 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.