From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: doc-view.el --- View PDF/PostScript/DVI files in Emacs Date: Sun, 26 Aug 2007 22:38:47 +0200 Message-ID: <858x7yav54.fsf@lola.goethe.zz> References: <87d4xd19f8.fsf@baldur.tsdh.de> <87ejhtkvc7.fsf@cadilhac.name> <87ir753qgu.fsf@baldur.tsdh.de> <85r6lsfw3q.fsf@lola.goethe.zz> <87zm0fmsod.fsf@baldur.tsdh.de> <854pincvkt.fsf@lola.goethe.zz> <87d4xalhqu.fsf@baldur.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1188194071 31003 80.91.229.12 (27 Aug 2007 05:54:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Aug 2007 05:54:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 27 07:54:28 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IPXYR-0001tY-FY for ged-emacs-devel@m.gmane.org; Mon, 27 Aug 2007 07:54:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IPXYQ-0000fB-Ge for ged-emacs-devel@m.gmane.org; Mon, 27 Aug 2007 01:54:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IPXYL-0000cq-51 for emacs-devel@gnu.org; Mon, 27 Aug 2007 01:54:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IPXYJ-0000ag-76 for emacs-devel@gnu.org; Mon, 27 Aug 2007 01:54:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IPXYJ-0000aM-0o for emacs-devel@gnu.org; Mon, 27 Aug 2007 01:54:19 -0400 Original-Received: from mail-in-01.arcor-online.net ([151.189.21.41]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IPXYI-0005oR-Ae for emacs-devel@gnu.org; Mon, 27 Aug 2007 01:54:18 -0400 Original-Received: from mail-in-12-z2.arcor-online.net (mail-in-12-z2.arcor-online.net [151.189.8.29]) by mail-in-01.arcor-online.net (Postfix) with ESMTP id B0AA615C041; Mon, 27 Aug 2007 07:54:16 +0200 (CEST) Original-Received: from mail-in-01.arcor-online.net (mail-in-01.arcor-online.net [151.189.21.41]) by mail-in-12-z2.arcor-online.net (Postfix) with ESMTP id A03DA279401; Mon, 27 Aug 2007 07:54:16 +0200 (CEST) Original-Received: from lola.goethe.zz (dslb-084-061-038-115.pools.arcor-ip.net [84.61.38.115]) by mail-in-01.arcor-online.net (Postfix) with ESMTP id 53522212F63; Mon, 27 Aug 2007 07:54:16 +0200 (CEST) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id A09261C46118; Sun, 26 Aug 2007 22:38:48 +0200 (CEST) In-Reply-To: <87d4xalhqu.fsf@baldur.tsdh.de> (Tassilo Horn's message of "Sun\, 26 Aug 2007 12\:20\:25 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Virus-Scanned: ClamAV 0.91.1/4071/Mon Aug 27 02:27:44 2007 on mail-in-01.arcor-online.net X-Virus-Status: Clean X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:77260 Archived-At: Tassilo Horn writes: > David Kastrup 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. PDF/PS and DVI files are primarily page-oriented formats. It does not make sense to display every page with a different size. 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. > If it can be useful if everything I have is the plain document with > no additional source or infos about included images, then I'll do > it. > > So can it do that? Can it do what? -- David Kastrup, Kriemhildstr. 15, 44793 Bochum