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: Tassilo Horn
Subject: Re: doc-view.el --- View PDF/PostScript/DVI files in Emacs
Date: Mon, 27 Aug 2007 10:52:04 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

David Kastrup <address@hidden> writes:

Hi David,

>>>> 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)?
>>
>> No, how should I get it?  I only have PDF/PS or DVI files with no
>> sources at all.
>
> I am afraid I can't figure out what you are trying to achieve.

Well, when doc-view.el used `convert' I supplied the -trim option to it.
This option cuts off the margins by calculating a mimimum bounding
rectangle around the contents whose outside has background color and
cuts the outside away.

> PDF/PS and DVI files are primarily page-oriented formats.  It does not
> make sense to display every page with a different size.

I don't agree here.  IMO it wastes too much screen estate to display the
margins.  When those were cut off I could split my emacs frame
horizontally and view a PDF doc in one window and have another
80-columns window for work.

Now that's not possible anymore because the images contain those huge
margins.  The only solution is to make the images smaller but that makes
them hard to read.  And I cannot scroll-left to center the image.  Even
`C-u 1 C-x <' scrolls too much.

I think that readability is much more important than displaying a page
exactly as it looks like in xpdf.

> PDF and PS files can actually change the page format in midstream _if_
> that is desired.  Autocropping will complicate the user's handling of
> page material.  This is different if we are talking about embedded
> material, graphics and stuff.  In that case, we will be using PDF
> (which sets its own page size) or EPS.  EPS files carry a bounding box
> comment: extracting that and using it for setting the rendering
> bounding box for Ghostscript should do the trick.
>
> preview-extract-bb in AUCTeX's preview.el can be used for that
> purpose.

Yes, but for other files like PDF or DVI that seems not possible.

Currently I don't really see how preview.el could be useful for
doc-view.  Ok, maybe I could display the first pages before the
conversion of the rest has finished, but with ghostview conversion is so
fast that I don't see any benefit that would justify to make the code
more complex.

For example doc-view on my practicalcommonlisp.pdf which has 528 pages
takes about one minute.  And even this has to be done only one time...

Maybe we confuse each other because we don't see the area of application
correctly.  doc-view.el is intended to view already finished documents
whereas preview.el is intended to view documents you're currently
writing.

So please give some concrete examples how I could enhance doc-view.el
with preview.el.
-- 
Newton's Third  Law is wrong: Although  it states that  for each action,
there is  an equal  and opposite  reaction, there is  no force  equal in
reaction to a Chuck Norris roundhouse kick.





reply via email to

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