From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carlos Aguilar Newsgroups: gmane.emacs.devel Subject: Re: Suggestion / feature request Date: Thu, 19 Apr 2012 19:15:28 +0200 Message-ID: <4F904830.5010401@unilim.fr> References: <4F901313.5040804@unilim.fr> <87sjfzst54.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------040102040308090502020404" X-Trace: dough.gmane.org 1334855762 16589 80.91.229.3 (19 Apr 2012 17:16:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 19 Apr 2012 17:16:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 19 19:15:58 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SKuxZ-00011a-4o for ged-emacs-devel@m.gmane.org; Thu, 19 Apr 2012 19:15:57 +0200 Original-Received: from localhost ([::1]:47943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKuxY-0008R3-AH for ged-emacs-devel@m.gmane.org; Thu, 19 Apr 2012 13:15:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKuxO-0008Qf-3K for emacs-devel@gnu.org; Thu, 19 Apr 2012 13:15:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKuxI-0008Co-Ru for emacs-devel@gnu.org; Thu, 19 Apr 2012 13:15:45 -0400 Original-Received: from mail.unilim.fr ([164.81.1.45]:52171 helo=smtp.unilim.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKuxI-0008Cb-76 for emacs-devel@gnu.org; Thu, 19 Apr 2012 13:15:40 -0400 Original-Received: from [164.81.39.165] ([164.81.39.165]) (authenticated bits=0) by smtp.unilim.fr (8.13.1/8.13.1) with ESMTP id q3JHFSLm012554 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Apr 2012 19:15:29 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 Thunderbird/3.1.20 In-Reply-To: <87sjfzst54.fsf@thinkpad.tsdh.de> X-TagToolbar-Keys: D20120419191528442 X-Univ-Limoges-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (smtp.unilim.fr [164.81.1.45]); Thu, 19 Apr 2012 19:15:29 +0200 (CEST) X-Univ-Limoges-MD: Pas de virus trouve X-Scanned-By: MIMEDefang 2.67 on 164.81.1.45 X-Univ-Limoges-MailScanner-Information: Serveur Anti-virus Please contact postmaster@unilim.fr for more information X-Univ-Limoges-MailScanner-ID: q3JHFSLm012554 X-Univ-Limoges-MailScanner: Found to be clean X-Univ-Limoges-MailScanner-Envelope-From: carlos.aguilar@unilim.fr X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 164.81.1.45 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149825 Archived-At: This is a multi-part message in MIME format. --------------040102040308090502020404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by smtp.unilim.fr id q3JHFSLm012554 I have found a simple test "by hand" that works. Initial conditions :=20 two files file1.pdf and file2.pdf with 101 pages and only a small=20 difference in page 85. time (mkdir file1_burst; cd file1_burst; pdftk ../file1.pdf burst; cd .. mkdir file2_burst; cd file2_burst; pdftk ../file2.pdf burst for I in pg*; do echo $I; diff -a $I ../file1_burst/$I|grep -v=20 'BaseFont\|FontName\|Creator\|Info\|...c...\|\-\-\-\|..c..'; done cd .. ; rm -Rf file1_burst; rm -Rf file2_burst) pg_0001.pdf pg_0002.pdf pg_0003.pdf pg_0004.pdf pg_0005.pdf =2E =2E =2E pg_0084.pdf pg_0085.pdf < x?T?n?0 ??W?(=015CQ?=15?^ < 0000059304 00000 n > 0000059305 00000 n < 0000059402 00000 n < 0000059466 00000 n < 0000059513 00000 n > 0000059403 00000 n > 0000059467 00000 n > 0000059514 00000 n < 59672 > 59673 pg_0086.pdf pg_0087.pdf pg_0088.pdf pg_0089.pdf pg_0090.pdf pg_0091.pdf pg_0092.pdf pg_0093.pdf pg_0094.pdf pg_0095.pdf pg_0096.pdf pg_0097.pdf pg_0098.pdf pg_0099.pdf pg_0100.pdf pg_0101.pdf real 0m7.009s user 0m6.160s sys 0m0.210s This can probably be optimized much. The only page for which there is a=20 difference is the one with a change. Doc-view reconversion needs in the=20 same computer 20 seconds. Cheers, Carlos Le 19/04/2012 16:17, Tassilo Horn a =E9crit : > Carlos Aguilar writes: > > Hi Carlos, > >> I often use doc-view mode with medium to large pdf/ps/dvi files, when >> writing/modifying latex documents. > Yes, frequently changing documents are clearly not the prime use-case > for doc-view, exactly because of the reasons you mention. Do you use > AUCTeX for writing your documents? If yes, then preview-latex might be > exactly what you need. > > ,----[ (info "(preview-latex)Top") ] > | preview-latex is a package embedding preview fragments into Emacs > | source buffers under the AUCTeX editing environment for LaTeX. It us= es > | `preview.sty' for the extraction of certain environments (most notabl= y > | displayed formulas). Other applications of this style file are > | possible and exist. > `---- > >> I wondered if it would be possible to keep a set of signatures of the >> pdf/ps/dvi pages processed so that those that are unchanged are not >> reconverted to (already existing) bitmap images. > Um, I have no idea how to do that. Doc-view only knows the PNG images > generated from the original document, and you can't compare those with > pages in the document. > > Well, it also has the old document's contents in the current buffer and > the updated document is on the file system, so in theory it could also > compare the documents. But I have no clue how to do that. Googling > around, I've found http://www.qtrac.eu/comparepdf.html, but I'm not sur= e > if it does the trick. (Oh, and of course if the comparison of the docs > is not significantly cheaper than a reconversion, there's no sense in > doing so. ;-)) > > Bye, > Tassilo --------------040102040308090502020404 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I have found a simple test "by hand" that works. Initial conditions : two files file1.pdf and file2.pdf with 101 pages and only a small difference in page 85.

time (mkdir file1_burst; cd file1_burst; pdftk ../file1.pdf burst; cd ..
mkdir file2_burst; cd file2_burst; pdftk ../file2.pdf burst
for I in pg*; do echo $I; diff -a $I ../file1_burst/$I|grep -v 'BaseFont\|FontName\|Creator\|Info\|...c...\|\-\-\-\|..c..'; done
cd .. ; rm -Rf file1_burst; rm -Rf file2_burst)

pg_0001.pdf
pg_0002.pdf
pg_0003.pdf
pg_0004.pdf
pg_0005.pdf
.
.
.
pg_0084.pdf
pg_0085.pdf
< xڅT�n�0
         ��W�(5CQ��^
< 0000059304 00000 n
> 0000059305 00000 n
< 0000059402 00000 n
< 0000059466 00000 n
< 0000059513 00000 n
> 0000059403 00000 n
> 0000059467 00000 n
> 0000059514 00000 n
< 59672
> 59673
pg_0086.pdf
pg_0087.pdf
pg_0088.pdf
pg_0089.pdf
pg_0090.pdf
pg_0091.pdf
pg_0092.pdf
pg_0093.pdf
pg_0094.pdf
pg_0095.pdf
pg_0096.pdf
pg_0097.pdf
pg_0098.pdf
pg_0099.pdf
pg_0100.pdf
pg_0101.pdf


real    0m7.009s
user    0m6.160s
sys    0m0.210s


This can probably be optimized much. The only page for which there is a difference is the one with a change. Doc-view reconversion needs in the same computer 20 seconds.


Cheers,

Carlos

Le 19/04/2012 16:17, Tassilo Horn a écrit :
Carlos Aguilar <carlos.aguilar@unilim.fr> writes:

Hi Carlos,

I often use doc-view mode with medium to large pdf/ps/dvi files, when
writing/modifying latex documents.
Yes, frequently changing documents are clearly not the prime use-case
for doc-view, exactly because of the reasons you mention.  Do you use
AUCTeX for writing your documents?  If yes, then preview-latex might be
exactly what you need.

,----[ (info "(preview-latex)Top") ]
|    preview-latex is a package embedding preview fragments into Emacs
| source buffers under the AUCTeX editing environment for LaTeX.  It uses
| `preview.sty' for the extraction of certain environments (most notably
| displayed formulas).  Other applications of this style file are
| possible and exist.
`----

I wondered if it would be possible to keep a set of signatures of the
pdf/ps/dvi pages processed so that those that are unchanged are not
reconverted to (already existing) bitmap images.
Um, I have no idea how to do that.  Doc-view only knows the PNG images
generated from the original document, and you can't compare those with
pages in the document.

Well, it also has the old document's contents in the current buffer and
the updated document is on the file system, so in theory it could also
compare the documents.  But I have no clue how to do that.  Googling
around, I've found http://www.qtrac.eu/comparepdf.html, but I'm not sure
if it does the trick.  (Oh, and of course if the comparison of the docs
is not significantly cheaper than a reconversion, there's no sense in
doing so. ;-))

Bye,
Tassilo
--------------040102040308090502020404--