From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/70169 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: OT: Pdf info Date: Wed, 20 Jul 2011 13:27:15 +0200 Message-ID: <4E26BB93.1010108@elvenkind.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1311161250 27360 80.91.229.12 (20 Jul 2011 11:27:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Jul 2011 11:27:30 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jul 20 13:27:26 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QjUw1-0007M9-Gs for gctc-ntg-context-518@m.gmane.org; Wed, 20 Jul 2011 13:27:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 503D8CAE56; Wed, 20 Jul 2011 13:27:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WAcMpIgolZ26; Wed, 20 Jul 2011 13:27:20 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 51EF4CAE47; Wed, 20 Jul 2011 13:27:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8D1B8CAE47 for ; Wed, 20 Jul 2011 13:27:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id v-hBZK0sQ1wS for ; Wed, 20 Jul 2011 13:27:16 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id AE9DACADE4 for ; Wed, 20 Jul 2011 13:27:16 +0200 (CEST) Original-Received: from pilot.elvenkind.com (elvenknd.xs4all.nl [82.95.203.226]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p6KBRFQX006168 for ; Wed, 20 Jul 2011 13:27:16 +0200 Original-Received: from localhost (pilot.elvenkind.com [127.0.0.1]) by pilot.elvenkind.com (Postfix) with ESMTP id 1597DA8B; Wed, 20 Jul 2011 13:23:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at localhost.localdomain Original-Received: from pilot.elvenkind.com ([127.0.0.1]) by localhost (pilot.elvenkind.com [127.0.0.1]) (amavisd-new, port 10025) with LMTP id cjaSGNFYnQsN; Wed, 20 Jul 2011 13:23:13 +0200 (CEST) Original-Received: from glenlivet.elvenkind.com (glenlivet.elvenkind.com [10.10.0.6]) by pilot.elvenkind.com (Postfix) with ESMTP id 845DCA88; Wed, 20 Jul 2011 13:23:13 +0200 (CEST) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.14) Gecko/20101022 Mandriva/3.0.9-0.1mdv2010.1 (2010.1) Thunderbird/3.0.9 In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=82.95.203.226; country=NL; region=11; city=Capelle; latitude=51.9333; longitude=4.5833; http://maps.google.com/maps?q=51.9333,4.5833&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rFabrgWm - 1dd0b96e992b - 20110720 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:70169 Archived-At: On 07/20/11 13:21, Proch=E1zka Luk=E1=B9 Ing. - Pontex s. r. o. wrote: > Hello, > = > this question in not straightly related to Context, but Context users > may have solved it and Ctx may be used to solve it. > = > I would need to get the following information from .pdf file(s): > = > - number of pages, > - common width and height of pages (provided that they are the same; > otherwise the dimension can be e.g. zero). There is the macro \getfiguredimensions which, amongst other things, sets up \noffigurepages, \figurewidth, and \figureheight. Here is an excerpt from a macro I have been using since 'forever': \newcount\imgcount % to store the number of pages \unexpanded\def\addimage#1{% \getfiguredimensions[#1.pdf]% \imgcount=3D\noffigurepages\relax \dorecurse {\the\imgcount} {\getfiguredimensions[#1.pdf][page=3D\recurselevel]% \ifdim\figurewidth>\figureheight ... \fi }} Best wishes, Taco ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________