Function: pdf-tools-pdf-buffer-p

pdf-tools-pdf-buffer-p is a natively compiled function defined in pdf-tools.el.

Signature

(pdf-tools-pdf-buffer-p &optional BUFFER)

Documentation

Check if the current buffer is a PDF document.

Optionally, take BUFFER as an argument and check if it is a PDF document.

Source Code

;; Defined in /nix/store/63h5z2vmzn0mfavcxi2idi23g5xcgkbl-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-20260102.1101/pdf-tools.el
(defun pdf-tools-pdf-buffer-p (&optional buffer)
  "Check if the current buffer is a PDF document.

Optionally, take BUFFER as an argument and check if it is a PDF document."
  (save-current-buffer
    (when buffer (set-buffer buffer))
    (save-excursion
      (save-restriction
        (widen)
        (goto-char 1)
        (looking-at "%PDF")))))