emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: doc-view.el --- View PDF/PostScript/DVI files in Emacs


From: David Kastrup
Subject: Re: doc-view.el --- View PDF/PostScript/DVI files in Emacs
Date: Sat, 25 Aug 2007 20:34:10 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Tassilo Horn <address@hidden> writes:

> David Kastrup <address@hidden> writes:
>
>> Have you tried out preview-latex (integrated with AUCTeX since
>> version 11.80)?  It displays images in Emacs buffers without
>> blocking Emacs at all, and renders stuff in the background with a
>> focus on material that is on-screen.
>
> I had a look at it but it didn't look that borrowing code there
> would simplify doc-view.el.

I was not thinking about simplification, but rather improvement.

>> It works using Ghostscript on either PDF or PostScript files (in
>> the latter case, dvips is used) or dvipng on DVI files.
>
> I changed doc-view.el so that it uses plain ghostscript (plus
> dvipdfm for DVI files) which gives good results and is about ten
> times faster than with ImageMagick's convert.
>
> The only downside is that I don't know how to cut off the margins.
> Those waste a lot of buffer space when displaying the image.
> converts -trim option was very nice for that cause.  Do you know how
> one can do that with ghostview?

Well, that is one of the things done in preview-latex.  Do you have
the bounding box information for your images (preview-latex takes them
from TeX usually)?

>> Ghostscript is used as a daemon in order to render the stuff in a
>> useful order, and a single Ghostscript session renders all images.
>
> Well, the conversion in doc-view.el runs asynchronous, too.  Users
> can go on with their work and eventually the *DocView* buffer will
> pop up.

preview-latex provides a working view of the buffer straight away,
rendering images and replacing place-holders first on the displayed
screen area, then off-screen.  That way, you get immediate visual
feedback where you need it, even though the rendering of thousands of
images might take a minute or so.

It is really several years of optimizations and user feedback that
went into the code base.  You should take it for a test drive before
deciding that its behavior does not suggest interesting material to
your project.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]