From 6047c5d39b4c09cd45cf8642a990ede4eb2a7c2a Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Thu, 20 May 2021 09:50:11 +0200 Subject: Update checkPDFPermissions --- .../at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas') diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java index d072a474..112d9a86 100644 --- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java +++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java @@ -18,7 +18,14 @@ public class PdfBoxUtils { throws PdfAsValidationException { AccessPermission accessPermission = doc.getCurrentAccessPermission(); if (doc.isEncrypted() || !accessPermission.isOwnerPermission()) { - if (accessPermission.canModify() || accessPermission.canModifyAnnotations() + //canFillInForm() + //This will tell if the user can fill in interactive form fields (including signature fields) even if + // canModifyAnnotations() returns false. + + //canModifyAnnotations() + //This will tell if the user can add or modify text annotations and fill in interactive forms fields and, if + // canModify() returns true, create or modify interactive form fields (including signature fields). + if ((accessPermission.canModify() && accessPermission.canModifyAnnotations()) || accessPermission.canFillInForm()) { logger.debug("Document is protected, but Signing is allowed"); -- cgit v1.2.3