احصل على امتيازات المستند
Contents
[
Hide
]
احصل على امتيازات المستند
استخدام PdfFileInfo.getDocumentPrivilege() لتفحص ما العمليات التي يسمح بها ملف PDF الحالي.
خطوات
- أنشئ كائن
PdfFileInfoلملف PDF الإدخال. - استدعِ
getDocumentPrivilege()لاسترجاع مجموعة الامتيازات. - اقرأ العلامات البوليانية ذات الصلة من القيم المسترجعة كائن
DocumentPrivilege. - أغلق
PdfFileInfoمثال عند الانتهاء.
مثال Java
public static void getDocumentPrivileges(Path inputFile) {
PdfFileInfo pdfInfo = new PdfFileInfo(inputFile.toString());
DocumentPrivilege privileges = pdfInfo.getDocumentPrivilege();
System.out.println("Document Privileges:");
System.out.println(" Can Print: " + privileges.isAllowPrint());
System.out.println(" Can Degraded Print: " + privileges.isAllowDegradedPrinting());
System.out.println(" Can Copy: " + privileges.isAllowCopy());
System.out.println(" Can Modify Contents: " + privileges.isAllowModifyContents());
System.out.println(" Can Modify Annotations: " + privileges.isAllowModifyAnnotations());
System.out.println(" Can Fill In: " + privileges.isAllowFillIn());
System.out.println(" Can Screen Readers: " + privileges.isAllowScreenReaders());
System.out.println(" Can Assembly: " + privileges.isAllowAssembly());
pdfInfo.close();
}