GNU bug report logs - #8519
24.0.50; doc-view: allow pdftotext -layout instead of -raw

Previous Next

Package: emacs;

Reported by: trentbuck <at> gmail.com (Trent W. Buck)

Date: Mon, 18 Apr 2011 09:24:03 UTC

Severity: normal

Tags: fixed

Found in version 24.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: 8519 <at> debbugs.gnu.org
Subject: bug#8519: 24.0.50; doc-view: allow pdftotext -layout instead of -raw
Date: Fri, 01 Jul 2011 00:57:45 +0300
> doc-view supports using pdftotext on ttys.
> Unfortunately it is hard-coded to pass -raw.
> I would prefer to pass -layout.
>
> Please modify doc-view to allow me to support something like
>
>     (setq doc-view-pdftotext-program-args '("-layout" "-nopgbrk"))

I came across the same need and found this bug report.

I think doc-view should also support other free software
that processes PDF files:

1. pdftk

pdftk is able to extract the PDF metadata (title, author, bookmarks, etc.),
e.g.

    pdftk file1.pdf dump_data output file1.txt

So for a large PDF document, doc-view could present the
Table of Contents where the user can navigate to the selected page,
and then convert only displayed pages instead of all pages
that is terribly slow for a 1000-page document.

pdftk also can prepare the PDF text for editing in emacs.
From `man pdftk':

  -compress useful when you want to edit PDF code
            in a text editor like vim or emacs.

   Uncompress PDF page streams for editing the PDF
   in a text editor (e.g., vim, emacs):

       pdftk doc.pdf output doc.unc.pdf uncompress

This feature could be used after typing `C-c C-c'.

Since pdftk is dependent on Java, doc-view should not require it
and should be able to detect the installed PDF processing programs
(with e.g. `(executable-find "pdftk")') and select one of them
according to the user's priority list.

2. A better program is `qpdf'. It has no problems mentioned above.
So doc-view should also detect the availability of
`(executable-find "qpdf")' as well and provide the same option for its
command line arguments (and use all features relevant to doc-view).

3. Using the PDF rendering library `poppler,' it's possible
to implement in Emacs a PDF viewer like `apvlv' for Vim.




This bug report was last modified 5 years and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.