Suppose I want to open the pdf file in the emacs. It is very easy in the emacs gui by using C-x C-f. But when I use it in emacs -nw. It shows the code instead of document. How can I do that? Thank you.
Asked
Active
Viewed 364 times
0
-
1Um… what do you expect to happen? How would a text-based terminal show PNG images? – ChrisGPT was on strike Sep 08 '15 at 20:49
-
@Chris So you mean it is impossible? – yuxuan Sep 09 '15 at 00:06
-
If you're using a traditional text-only terminal, and wanting to see the pages graphically, yes it's impossible. Have you ever seen images displayed in a terminal? – ChrisGPT was on strike Sep 09 '15 at 00:28
1 Answers
0
If you just want to read the pdf as text you can dot it with pdf2txt and this function:
(defun open-pdf-in-txt (arg)
(interactive "fpdf: ")
(shell-command
(format (concat "pdftotext " (replace-regexp-in-string " " "?\ " arg) " -layout")))
(find-file (replace-regexp-in-string "pdf" "txt" arg)))

djangoliv
- 1,698
- 14
- 26