Skip to content
Lamina PDF
0.9.0
GitHub
Open the web app

owner-password-required

All codes

  • Type: error
  • Kind: security (encryption, permissions or signatures block the call, or look tampered with)

What happened

A request to remove a file’s protection, or to change its passwords or limits, came from a file that was opened with a password that restricts what the file allows. That includes the empty password a file opens with when it asks for none.

Copying pages out of such a file into any other document is refused the same way, unless the file allows copying (Decided by the owner, #900). The other document’s own protection isn’t looked at. That covers:

  • extracting, exporting or splitting the file’s pages;
  • merging it into another file, or inserting or replacing pages from it, including into itself through its own bytes added as a source;
  • placing one of its pages as a picture (a form object).

Allowing assembly isn’t enough: it lets a reader rearrange the file itself, not take its content elsewhere. Only these page copies are checked. Extracting text, converting to Markdown and the viewer’s copy layer don’t ask.

Why

Only the owner of a protected file may lift its limits. A file opened with its permissions (owner) password may change its protection, and so may one opened with a password that already allows everything. Lamina PDF makes this check itself, before the change is applied and again when the file is saved, so no interface can skip it. A page copied into a new document leaves the protection behind, so the same check applies, eased only by the limit that covers that operation. For AES-256 files the limits count only when the file’s signed copy of them (/Perms) agrees.

The check stops a limit edited by hand. It does not stop someone who holds the open password of an AES-256 file and sets out to defeat it, since that password unlocks the file’s key.

How to fix

Ask for the file’s permissions password and give it before the change or the copy (authenticateOwner in the SDK), or open the file with that password; for a source, add its bytes again with the permissions password (addSource).

The same step lets you place one of its pages as a picture. Add that PDF’s bytes with the permissions password (addSource) and apply the edit again: a page placed from the same bytes is read from that source. If nobody has the password, the protection stays.

Example

Opening a file with its open password, which forbids copying, then removing its protection or extracting its first page.

Data fields

None.