GNU bug report logs - #8364
24.0.9999; PATCH: Fit to width/height/page for doc-view.el

Previous Next

Package: emacs;

Reported by: Tassilo Horn <tassilo <at> member.fsf.org>

Date: Mon, 28 Mar 2011 10:09:02 UTC

Severity: wishlist

Tags: patch

Found in version 24.0.9999

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 8364 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tassilo <at> member.fsf.org>
To: sho nakatani <lay.sakura <at> gmail.com>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 8364 <at> debbugs.gnu.org
Subject: Re: bug#8364: 24.0.9999;
	PATCH: Fit to width/height/page for doc-view.el
Date: Mon, 28 Mar 2011 17:28:33 +0200
sho nakatani <lay.sakura <at> gmail.com> writes:

Hi!

>> Good, thanks.  I'll still have to do it by hand, sadly, since I like
>> to "fit the text" rather than "fit the page", i.e. I like to keep the
>> margins outside of the viewable area.  A command to do that
>> automatically would be really nifty.
>
> Sad to say, I have no idea to realize such function, although I completely
> agree with you.
> Currently, the scale factor for enlarge/shrink is determined by the ratio of
> the size of PNG image to the size of window. It is pretty difficult to specify
> where 'margins' are from PNG image.

Users can cut the margins using the slice feature (`s m').  The
information about the current slice (X Y WIDTH HEIGHT) can be accessed
using the `doc-view-current-slice' macro.  So it seems doable to
calculate the right zoom factor and adjust the slice accordingly after
zooming if a slice was set.  How that can be done is left as an exercise
to the reader. ;-)

Nakatani, feel free to implement that, and send updated patches to this
"bug" report.

> It might be possible if the scale factor is determined not from PNG
> image but from PDF/PS.  However, it is far difficult than current
> implementation.

I'd advice not to add special-case code for certain kinds of documents.

Bye,
Tassilo




This bug report was last modified 14 years and 44 days ago.

Previous Next


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