Skip to main content
Participating Frequently
October 26, 2021
Question

How to get permissions of the file?

  • October 26, 2021
  • 1 reply
  • 639 views

Hello!

I have a file(s) with some permissions (like in the picture).

How I can read these permission(s) for prepending users to upload this file to the server?

I used pdfservices-sdk-2.1.0 library for Java.

PS: The file with the properties above is already signed, but anyway how I can do it?

This topic has been closed for replies.

1 reply

Joel Geraci
Community Expert
Community Expert
October 26, 2021

If the document is encrypted with a permissions password, you'll see a "permissions" property in the returned JSON. The permissions.permissions properties will tell you what the users can do. Signing and form filling use the same permission bit.

 

    "permissions": {
        "encryption": {
            "encrypt_attachments_only": false,
            "has_owner_password": true,
            "encrypt_metadata": true,
            "has_user_password": false,
            "bit_length": 256,
            "algorithm": "AES"
        },
        "permissions": {
            "assistive_technology": true,
            "form_filling": true,
            "copying": false,
            "page_extraction": true,
            "document_assembly": false,
            "commenting": true,
            "printing": "low_quality",
            "editing": false
        }
    },

 

EvgeniiGAuthor
Participating Frequently
October 26, 2021

Thanks, for the answer. The document is not encrypted and I got the JSON without the "permissions" property. As I understand it, if we want to get/set any permissions to a file, we have to use an encrypted version of that file?

Joel Geraci
Community Expert
Community Expert
October 26, 2021

I'm curious how the permissions are being set without security being applied. Can you share the file?