【发布时间】:2017-04-14 11:02:03
【问题描述】:
我正在尝试检查要上传的 PDF 文档是否具有以下文档属性 - 使用 iTextSharp PDFReader 允许/不允许访问内容复制和内容复制。是否有任何属性可以验证此功能。我粘贴了一个未返回预期结果的示例代码。
寻找使用 iTextSharp 的解决方案
示例代码:
using (PdfReader r = new PdfReader(@"xxx\yyy.pdf"))
{
if (PdfEncryptor.IsScreenReadersAllowed((int)(r.Permissions)))
{
Console.WriteLine("Content Accessibility Enabled");
}
if (PdfEncryptor.IsCopyAllowed((int)(r.Permissions)))
{
Console.WriteLine("Copy Enabled");
}
if (PdfEncryptor.IsAssemblyAllowed((int)(r.Permissions)))
{
Console.WriteLine("Document Assembly Enabled");
}
}
【问题讨论】:
-
已纠正错字。
标签: c# itext pdf-reader