From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74640 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?B?UHJvY2jhemthIEx1a+G5IEluZy4gLSBQb250ZXggcy4gci4gby4=?= Newsgroups: gmane.comp.tex.context Subject: Re: Page count of PDF file from lua Date: Wed, 22 Feb 2012 14:42:05 +0100 Message-ID: References: <20120219145015.7fe6626d@homerow> <4F4390BA.9000503@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1329918169 18019 80.91.229.3 (22 Feb 2012 13:42:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Feb 2012 13:42:49 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Feb 22 14:42:39 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S0CSp-0007zz-O3 for gctc-ntg-context-518@m.gmane.org; Wed, 22 Feb 2012 14:42:36 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2DCF8CB239; Wed, 22 Feb 2012 14:42:34 +0100 (CET) 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 qyYyBxJUOc6l; Wed, 22 Feb 2012 14:42:28 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 813EFCB232; Wed, 22 Feb 2012 14:42:28 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 83BF0CB232 for ; Wed, 22 Feb 2012 14:42:27 +0100 (CET) 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 zEAL0BREeCZv for ; Wed, 22 Feb 2012 14:42:22 +0100 (CET) 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 00C5FCAB03 for ; Wed, 22 Feb 2012 14:42:21 +0100 (CET) Original-Received: from mail.pontex.cz (mail.pontex.cz [89.233.168.98]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q1MDgGN9023592 for ; Wed, 22 Feb 2012 14:42:19 +0100 Original-Received: from localhost ([127.0.0.1]) by mail.pontex.cz (Kerio MailServer 6.6.2) for ntg-context@ntg.nl; Wed, 22 Feb 2012 14:42:12 +0100 In-Reply-To: <4F4390BA.9000503@wxs.nl> User-Agent: Opera Mail/11.61 (Win32) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=89.233.168.98; country=CZ; region=52; city=Prague; latitude=50.0833; longitude=14.4667; http://maps.google.com/maps?q=50.0833,14.4667&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rGB1Ghlg - 831c92449b5b - 20120222 (trained as not-spam) 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:74640 Archived-At: ... Some solutions can be found here, too: http://www.mail-archive.com/ntg-context@ntg.nl/msg57502.html http://www.mail-archive.com/ntg-context@ntg.nl/msg57503.html Lukas On Tue, 21 Feb 2012 13:40:26 +0100, Hans Hagen wrote: > On 19-2-2012 14:50, Marco wrote: >> I can't figure out how to determine the number of pages of a PDF >> file within lua. From the TeX side it works with >> \getfiguredimensions >> >> Can somebody give me a nudge in the right direction? Example: >> >> \starttext >> >> % Works >> %\getfiguredimensions [somefile.pdf] >> >> \startluacode >> -- Does not work >> context.getfiguredimensions({"somefile.pdf"}) >> >> local numpages =3D figures.get("used", "pages", 0) >> context(numpages) >> \stopluacode >> >> \stoptext > > something > > local fig =3D figures.push { name =3D "somefile.pdf" } > figures.identify() > figures.check() > local nofpages =3D fig.used.pages > figures.pop() > > > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com > | www.pragma-pod.nl > ----------------------------------------------------------------- > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to= the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ > -- = Ing. Luk=E1=B9 Proch=E1zka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezov=E1 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________