Hot answers tagged

17

You can give a try to pdf-tools, which provides most of the requested functionality


16

Since Emacs 23, you can view PDF files as images just by opening them like normal files as long as you have Emacs running in X rather than a terminal. You can also see and edit the PDF directly, which will display the contents of the binary file as text (with lots of unprintable characters!). You can edit this text directly, but unless you can encode and ...


8

The default resolution is probably around 90 dpi. (require 'doc-view) (setq doc-view-resolution 144) (Or set higher as you need.) You may need to run doc-view-clear-cache first for the change to be respected.


7

pdf-tools If you decide to install pdf-tools package (also available on Melpa) to view PDF files (instead of doc-view-mode), you can view the PDF in "midnight mode" by using the default binding C-c C-r m or by doing M-x pdf-view-midnight-minor-mode. The default colors of this minor mode are, Foreground color - #839496 Background color - #002b36 But you ...


7

Try nov (installable via melpa). It is a reasonable start for reading ePUBs in Emacs.


7

The variable is large-file-warning-threshold. Documentation: large-file-warning-threshold is a variable defined in `files.el'. Its value is 10000000 Documentation: Maximum size of file above which a confirmation is requested. When nil, never request confirmation. You can customize this variable. This variable was introduced, or its default value was ...


6

If by "render larger" you mean that the dimensions of the rendered png image are larger, then you could use some of the doc-view functions to fit the image to your window: doc-view-fit-page-to-window, doc-view-fit-width-to-window, and doc-view-fit-height-to-window. In other words, increase the resolution of the rendered image as you did, and then fit (...


5

Mode hooks exist, whether or not they are predefined variables. If doc-view-mode is a major mode then doc-view-mode-hook is alive and well. That is to say that the coding conventions call for a major mode to run its mode hook when the mode is turned on. But typically no hook variable is predefined. The doc for define-derived-mode tells you that the newly ...


5

This feature does not yet seem to exist. I have opened an issue requesting this feature on pdf-tools git.


4

.epub are in fact .zip file with .xhtml file inside. You can just open them, find the .xhtml file that has the content (often content.html), and open it. Then you can call shr-render-buffer to display the html. This do not solve several problem: finding automatically the correct .xhtml use the table of content, bigger epub have several .xhtml (say, one by ...


4

In pdf-tools you can type M-g l (pdf-view-goto-label), which asks for a page-label, which is usually equal to the displayed page-number.


4

I fixed the problem by using M-x customize-variable org-file-apps and adding a cons-cell with Extension: \.pdf\' and Command: evince %s at the top. Oddly enough, links starting with file+sys: still open in emacs doc-view, while links starting with file: open in evince (regadless of absolute or relative path). But I don't care because there's no ...


3

I had a similar problem with PDFView and it turned out that the flickering was caused by Blink-Cursor mode. Try to disable this minor mode in the buffer.


2

I use the following functions to reverse the colors in a PDF. Note that it uses ImageMagick under the hood and will not work without it: (defun define-doc-view-current-cache-dir () ;; doc-view-current-cache-dir was renamed to doc-view--current-cache-dir in Emacs 24.5 (or (fboundp 'doc-view-current-cache-dir) (defalias 'doc-view-current-cache-dir '...


2

The variable doc-view-ghostscript-program is customizable: (setq doc-view-ghostscript-program "C:/Program Files (x86)/gs/gs9.09/bin/gswin32.exe")


2

I added (add-to-list 'org-file-apps '("pdf" . "evince %s")) to my init-file. Now C-c C-o opens any PDF in evince and C-u C-u C-c C-o opens them in doc-view.


2

Look into helm's persistent actions. Basically allows you to execute an action (like opening the PDF) without ending the helm session. If your helm-bibtex is setup to use pdf-tools for viewing PDFs (see helm-bibtex-pdf-open-function), you're basically good to go.


2

Indirect buffer need special support, since their buffer-file-name is nil. But this is currently not implemented in pdf-tools. So it seems that the answer is no.


2

There is org-docview which allows you to create usual org-links to documents open in docview-mode. Using C-c l you can store a link and using C-c C-l you can insert it. I would actually suggest using pdf-tools with org-pdfview. Both are on melpa and on github.


2

Other than the (rassq-delete-all #'doc-view-mode-maybe auto-mode-alist) suggested by Tyler (but note you need to use ...-maybe), you can also be more drastic: ;; Die, Doc-View-mode! die! (defalias 'doc-view-mode #'doc-view-fallback-mode) ;Or fundamental-mode, ...


1

mutool.exe is enough to view PDF in Emacs, put mutool.exe in .exec-path. doc-view-mode-p function always return nil for 'pdf TYPE. you need to let doc-view-mode-p return t for 'pdf. (defadvice doc-view-mode-p (after doc-view-mode-p-after compile) "fix: the builtin `doc-view-mode-p' does not support mupdf." (when (eq 'pdf (ad-get-arg 0)) (setq ad-...


1

This does not directly answer your question, but pdf-tools now works on windows without problems. It works very well with interleave-mode. I followed the compilation instructions under https://github.com/politza/pdf-tools using msys2 (no cygwin needed). I had some problems getting pdf-tools to find epdfinfo.exe (the file created by the compilation step ...


1

It should just work as long as doc-view-pdfdraw-program either contains the absolute file name of the mudraw executable, or the executable can be found in exec-path. If that is the case, then doc-view-pdf->png-converter-function should automatically default to the proper function, i.e. doc-view-pdf->png-converter-mupdf.


1

Sorry, the answer is simple: the string constant in (setq doc-view-ghostscript-program "C:\gs\gs9.20\bin") is wrong; the backslashes seem to be interpreted as special characters. And I forgot to specify the program. The correct statement is: (setq doc-view-ghostscript-program "C:/gs/gs9.20/bin/gswin64c.exe")


1

Some years ago I wrote a dired-based interface to tracker results. It's not polished, but in case it is of any use, you can find the code here: https://www.emacswiki.org/emacs/Tracker


1

Looking at Martin's link to using baloo under KDE, the following function calls tracker's sparql query and shows the results in a new frame. A lot more needs to be done and could be added to make this really useful. The results are shown in a file URI format, and find-file-at-point works to open the documents in DocView mode. I use this mainly to use full-...


1

When you open a encrypted file, Emacs automatically replaces the contents of it's buffer with a decrypted version of it. Though doc-view, and for that matter pdf-view as well, does not care for the actual buffer content, but rather uses the buffer's file-name with various programs, in your case ghostscript, in order to produce images of the PDF pages. ...


1

https://github.com/railwaycat/emacs-mac-port this will actually help you . It has retina display build in support in the doc-view-mode.


1

I recommend emacs-ereader. My experience is that it errs out less often while parsing an epub than nov and it too is installable as a package. Further, it supports annotations, integrates decent with Org, in a slightly more primitive way than the awesome pdf-tools does for PDFs.


1

When doc-view-mode is enabled, mwheel-scroll-up-function is set locally to be doc-view-scroll-up-or-next-page; and, mwheel-scroll-down-function is set locally to be doc-view-scroll-down-or-previous-page. The preferred behavior sought by the original poster in the question above is that the mouse-wheel activate doc-view-next-page and doc-view-previous-page ...


Only top voted, non community-wiki answers of a minimum length are eligible