1

In DocView (without pdf-tools installed) I could hit C-c C-c to toggle between viewing-mode and editing-mode. After installing pdf-tools I expected C-c C-c to act the same. But now it toggles between PDFView and DocView, without any editing mode. What can I do to make it toggle between PDFView and editing mode?

2 Answers 2

1

The name of the command you would need to invoke to edit the pdf is:

M-x pdf-virtual-edit-mode

I don't think toggling is possible but I may be wrong.

1

Using the standard hooks to remap C-c C-c and use it as a toggle key, seems to be the easiest way:

;; edit -> view
(add-hook 'pdf-virtual-edit-mode-hook
          (lambda ()
            (define-key pdf-virtual-edit-mode-map (kbd "C-c C-c") #'pdf-view-mode)
            ))

;; view -> edit
(add-hook 'pdf-view-mode-hook
          (lambda ()
            (define-key pdf-view-mode-map (kbd "C-c C-c") #'pdf-virtual-edit-mode)
            ))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.