Skip to main content
Participating Frequently
Oct 26, 2021 11:27 AM UTC
Question

How to get permissions of the file?

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 is closed to new replies. Start a new post to keep the conversation going.

6 replies

Joel Geraci
Community Expert
Community Expert
Oct 26, 2021 7:11 PM UTC

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
        }
    },

 

Translate
EvgeniiGAuthor
Participating Frequently
Oct 26, 2021 8:44 PM UTC

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?

Translate
Joel Geraci
Community Expert
Community Expert
Oct 26, 2021 8:50 PM UTC

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

Translate