# ChangeProtection

The **Change Protection** function provides a way to change the protection settings on a PDF document without modifying the document contents. No further options other than the input and output PDF settings are required.

***

## Properties <a href="#properties" id="properties"></a>

### Input <a href="#input" id="input"></a>

The following properties specify the PDF document to be loaded and modified by the operation:

#### File path <a href="#file-path" id="file-path"></a>

Path to the PDF file.

#### Authentication type <a href="#authentication-type" id="authentication-type"></a>

PDF files can be protected using a password or a certificate. This field indicates which type of authentication to attempt when loading the PDF.

1. **None**\
   The document is unprotected and can be opened immediately.
2. **Password**\
   The document is protected by a password.
3. **Certificate**\
   The document is protected by a certificate.

***

**Password**:\
Only displayed when **Authentication type** is 'Password'.

* **Password**: Password required to access the PDF file.

***

**Certificate**:\
Only displayed when **Authentication type** is 'Certificate'.

**Certificate source**:\
Source to load the certificate from:

1. **File** - Load a certificate from a .pfx file.
2. **Store** - Load a certificate from the Windows certificate store.

**File** Displayed when **Certificate source** is 'File'.

**Certificate file path**:\
Path to a .pfx file containing a certificate.

**Certificate file password**:\
Password needed to open the certificate file.

**Store**:\
Displayed when **Certificate source** is 'Store'.

**Certificate**:\
Certificate in the Windows keystore.

{% hint style="info" %}

> **Note:**\
> All passwords entered into this function's properties will be visible in plain text in the Linx solution file and in the compiled .NET assembly.
> {% endhint %}

{% hint style="info" %}

> **Note:**\
> Certificate protected files are not supported by the "Fill form", "Sign", "Add watermark," and "Concatenate" operations. If you need to use the operations on a certificate-protected document, first remove the certificate protection using the "Change protection" operation. The certificate must include the private key in order to be able to load the document.
> {% endhint %}

***

### Output <a href="#output" id="output"></a>

#### File path <a href="#output-file-path" id="output-file-path"></a>

Path of the PDF file to write to.

#### Authentication type <a href="#output-authentication-type" id="output-authentication-type"></a>

Authentication type required to open the PDF file.

1. **None**\
   No protection.
2. **Password**\
   The PDF will ask for a password before opening.
3. **Certificate**\
   The PDF will only be readable by the owner of the specified certificate.

**Password**:\
Password required to gain user-level access to the PDF.\
If you would like to allow user-level access without requiring a password, leave this field blank.

***

**Certificate**:\
The following fields are available when **Authentication type** is set to 'Certificate'.

**Certificate source**:\
Source to load the owner's certificate.

1. **File** - Load the certificate from a .pfx file.
2. **Store** - Load the certificate from the Windows key store.

***

**File**

**Certificate file path**:\
Path to a .pfx file containing the signing certificate.

**Certificate file password**:\
Password needed to decrypt the certificate file.

**Store**:\
**Certificate**:\
Certificate in the Windows keystore.

#### Add document restrictions <a href="#document-restrictions" id="document-restrictions"></a>

Specify restrictions on the PDF document.

* **Allow printing**: The level of printing allowed on the PDF document.
* **Allow changes**: The editing actions allowed on the PDF document.
* **Allow copying**: Enable copying of text, images, and other content.
* **Allow screen readers**: Enable text access for screen reader devices for the visually impaired.

#### Encryption <a href="#encryption" id="encryption"></a>

Encryption method used to protect the PDF contents.

**Options:**

* Standard encryption (40 bit)
* Standard encryption (128 bit)
* AES encryption (128 bit)
* AES encryption (256 bit)

{% hint style="info" %}

> **Note:**\
> AES encryption is stronger than standard (RC4) encryption but is only supported by newer versions of Acrobat Reader. If the document needs to be read by any Acrobat versions prior to Acrobat X, standard encryption should be used.
> {% endhint %}

* **Don't encrypt metadata**: Prevents encryption of the document metadata.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.linx.software/reference/plugins/pdf/content/changeprotection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
