From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74619 Path: news.gmane.org!not-for-mail From: Marco Newsgroups: gmane.comp.tex.context Subject: Re: Page count of PDF file from lua Date: Tue, 21 Feb 2012 14:03:13 +0100 Message-ID: <20120221140313.70744b7a@homerow> 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="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1329829413 12221 80.91.229.3 (21 Feb 2012 13:03:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2012 13:03:33 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Feb 21 14:03:27 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 1RzpNO-0000hp-Bd for gctc-ntg-context-518@m.gmane.org; Tue, 21 Feb 2012 14:03:26 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0670BCB232; Tue, 21 Feb 2012 14:03:26 +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 4X1qM2uoF1n6; Tue, 21 Feb 2012 14:03:18 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DE5B6CB229; Tue, 21 Feb 2012 14:03:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 97C9FCB229 for ; Tue, 21 Feb 2012 14:03:16 +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 sBaE-BdDrCoO for ; Tue, 21 Feb 2012 14:03:08 +0100 (CET) Original-Received: from filter1-nij.mf.surf.net (filter1-nij.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 3A99ECB211 for ; Tue, 21 Feb 2012 14:03:08 +0100 (CET) Original-Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by filter1-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q1LD34IQ013460 for ; Tue, 21 Feb 2012 14:03:07 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1RzpN0-0000TG-1W for ntg-context@ntg.nl; Tue, 21 Feb 2012 14:03:02 +0100 Original-Received: from 83.68.239.197 ([83.68.239.197]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Feb 2012 14:03:02 +0100 Original-Received: from netuse by 83.68.239.197 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Feb 2012 14:03:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 15 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 83.68.239.197 X-Newsreader: Claws Mail 3.8.0 (GTK+ 2.24.9; x86_64-pc-linux-gnu) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.3; country=NO; latitude=62.0000; longitude=10.0000; http://maps.google.com/maps?q=62.0000,10.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07GAB35Ko - 68a47c287ce7 - 20120221 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.152 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:74619 Archived-At: On 2012-02-21 Hans Hagen wrote: > > I can't figure out how to determine the number of pages of a PDF > > file within lua. > > local fig = figures.push { name = "somefile.pdf" } > figures.identify() > figures.check() > local nofpages = fig.used.pages > figures.pop() Thanks for the snippet, Hans. Marco ___________________________________________________________________________________ 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-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________