Function: pdf-info-encrypted-p
pdf-info-encrypted-p is a natively compiled function defined in
pdf-info.el.
Signature
(pdf-info-encrypted-p &optional FILE-OR-BUFFER)
Documentation
Return non-nil if FILE-OR-BUFFER requires a password.
Note: This function returns nil, if the document is encrypted, but was already opened (presumably using a password).
Source Code
;; Defined in /nix/store/63h5z2vmzn0mfavcxi2idi23g5xcgkbl-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-20260102.1101/pdf-info.el
(defun pdf-info-encrypted-p (&optional file-or-buffer)
"Return non-nil if FILE-OR-BUFFER requires a password.
Note: This function returns nil, if the document is encrypted,
but was already opened (presumably using a password)."
(condition-case err
(pdf-info-open
(pdf-info--normalize-file-or-buffer file-or-buffer))
(error (or (string-match-p
":Document is encrypted\\'" (cadr err))
(signal (car err) (cdr err))))))