Password-protect PDF
pdf_protectEncrypt a PDF with a password. user_password is required to open the result; owner_password lifts the permission restrictions. Give at least one (each 1 to 32 Latin-1 chars). permissions lists what stays ALLOWED from print, copy, modify, annotate, fill-forms (default all, except modify when an owner password is set; an empty list allows none). Restrictions only bind viewers when an owner password is set. Not byte-deterministic (random salts). Returns the result inline as an application/pdf resource; the source is never modified.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pdf_path": "<pdf_path>"
},
"name": "pdf_protect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| password | No | Password to open the input, only needed for a user-password PDF (owner-locked files with an empty user password open without it). | |
| pdf_path | Yes | PDF source: an https:// URL or a data:application/pdf;base64,… URI (this hosted server cannot read local file paths). | |
| permissions | No | Actions to ALLOW; omit for the default, [] for none | |
| user_password | No | Password required to open the output | |
| owner_password | No | Password that lifts the restrictions |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bytes | Yes | Size of the produced PDF in bytes | |
| resource_uri | No | pdfops:// uri of the inline application/pdf resource |