문서 권한 얻기

문서 권한 얻기

현재 PDF에서 허용하는 작업을 검사하려면 PdfFileInfo.getDocumentPrivilege()를 사용하세요.

단계

  1. 입력 PDF에 대한 PdfFileInfo 개체를 만드세요.
  2. 권한 범위를 검색하려면 getDocumentPrivilege()를 호출하세요.
  3. 반환된 DocumentPrivilege 개체에서 관련 부울 플래그를 읽으세요.
  4. 완료되면 PdfFileInfo 인스턴스를 닫으세요.

Java 예제```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();

}