# Add restrictions to a PDF

Set the permission flags that control copying, printing, and editing a PDF, in a Power Automate flow. No code, and nothing is stored.

Use this action to add restrictions to prevent copying, printing, and modifying a PDF document.

<PowerAutomateAction
  title="Add restrictions to a PDF"
  caption="Add restrictions to a PDF."
  connection="PDF Blocks Next"
  fields={[
    { label: "File Content", kind: "token", value: "File Content", required: true },
    { label: "Owner Password", placeholder: "The password required to open and change permissions", required: true },
    { label: "User Password", placeholder: "The password required to open the PDF document" },
    { label: "Allow Copy Content", kind: "select", value: "Yes", options: ["Yes", "No"] },
    { label: "Allow Change Content", kind: "select", value: "Yes", options: ["Yes", "No"] },
    { label: "Allow Print", kind: "select", value: "Yes", options: ["Yes", "No"] },
    { label: "Allow Print High Resolution", kind: "select", value: "Yes", options: ["Yes", "No"] },
    { label: "Allow Comment And Fill Form", kind: "select", value: "Yes", options: ["Yes", "No"] },
    { label: "Allow Fill Form", kind: "select", value: "Yes", options: ["Yes", "No"] },
    { label: "Allow Assemble Document", kind: "select", value: "Yes", options: ["Yes", "No"] },
    { label: "Allow Accessibility", kind: "select", value: "Yes", options: ["Yes", "No"] },
    { label: "Encryption Algorithm", kind: "select", value: "AES-128", options: ["AES-128", "AES-256"], advanced: true },
  ]}
/>

<ConnectorNotice kind="parameter" />

The PDF specification allows setting restrictions to some uses, such as copy, print, filling forms, etc. It's up to each PDF software to enforce these restrictions, and they are [trivial to remove](https://www.google.com/search?q=remove+PDF+permissions+online). This is described on page 60 of the [PDF specification](https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf):

> Once the document has been opened and decrypted successfully, a conforming reader technically has access to the entire contents of the document. There is nothing inherent in PDF encryption that enforces the document permissions specified in the encryption dictionary.

## Parameters

<ParamField name="File Content" type="File" required>
  The content of the input PDF document.
</ParamField>

<ParamField name="Owner Password" type="String" required>
  The password required to open and change permissions of the PDF document. The length is between 4 and 32 characters. The characters in the password must be in the ASCII printable range (between positions 32 and 126). This range includes lowercase and uppercase letters, numbers, space, and some commonly used symbols like . , : ; # $ % & ( ) * + = ? !
</ParamField>

<ParamField name="User Password" type="String">
  The password required to open the PDF document. This field is optional. Has the same requirements as Owner Password.
</ParamField>

<ParamField name="Allow Copy Content" type="Boolean" default="Yes">
  If set to Yes, users can copy the text, images, and other content to the clipboard. This field is optional.
</ParamField>

<ParamField name="Allow Change Content" type="Boolean" default="Yes">
  If set to Yes, users can change the content of the document. This field is optional.
</ParamField>

<ParamField name="Allow Print" type="Boolean" default="Yes">
  If set to Yes, users can print the document. This field is optional.
</ParamField>

<ParamField name="Allow Print High Resolution" type="Boolean" default="Yes">
  If set to Yes, users can print the document in high resolution. This field is optional.
</ParamField>

<ParamField name="Allow Comment And Fill Form" type="Boolean" default="Yes">
  If set to Yes, users can add, edit and modify annotations and fill form fields. This field is optional.
</ParamField>

<ParamField name="Allow Fill Form" type="Boolean" default="Yes">
  If set to Yes, users can fill form fields. This field is optional.
</ParamField>

<ParamField name="Allow Assemble Document" type="Boolean" default="Yes">
  If set to Yes, users can assemble and manipulate the document (add or remove pages, merge, etc). This field is optional.
</ParamField>

<ParamField name="Allow Accessibility" type="Boolean" default="Yes">
  If set to Yes, accessibility programs can read the text and images of the document. This field is optional.
</ParamField>

<ParamField name="Encryption Algorithm" type="String" default="AES-128">
  The algorithm used to encrypt the PDF document. This field is optional. Valid values are AES-128 and AES-256.
</ParamField>

## Response

<ParamField name="Locked PDF File Content" type="File">
  The content of the locked PDF document. You can use it as an input to other actions in your flow.
</ParamField>

## Related actions

<CardGroup cols={2}>

<Card title="Remove restrictions" href="/docs/power-automate/remove-restrictions-from-pdf">
  Clear all restrictions from a document.
</Card>

<Card title="Add password" href="/docs/power-automate/add-password-to-pdf">
  Require a password to open the document.
</Card>

<Card title="Remove password" href="/docs/power-automate/remove-password-from-pdf">
  Take the password off an encrypted document.
</Card>

<Card title="Remove signatures" href="/docs/power-automate/remove-signatures-from-pdf">
  Strip cryptographic signatures from a document.
</Card>

</CardGroup>
