From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74582 Path: news.gmane.org!not-for-mail From: Marco Newsgroups: gmane.comp.tex.context Subject: Page count of PDF file from lua Date: Sun, 19 Feb 2012 14:50:15 +0100 Message-ID: <20120219145015.7fe6626d@homerow> 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 1329659412 17247 80.91.229.3 (19 Feb 2012 13:50:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2012 13:50:12 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Feb 19 14:50:12 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 1Rz79X-0002FD-Nf for gctc-ntg-context-518@m.gmane.org; Sun, 19 Feb 2012 14:50:11 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 61481CB2C3; Sun, 19 Feb 2012 14:50:11 +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 cBj+2oKaUk3D; Sun, 19 Feb 2012 14:50:07 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C1A09CB2B3; Sun, 19 Feb 2012 14:50:07 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 74DB9CB2B3 for ; Sun, 19 Feb 2012 14:50:06 +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 oZ5oITlFY5oL for ; Sun, 19 Feb 2012 14:50:04 +0100 (CET) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id C6355CB20F for ; Sun, 19 Feb 2012 14:50:04 +0100 (CET) Original-Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q1JDo2qG031709 for ; Sun, 19 Feb 2012 14:50:04 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rz79O-0002A4-0N for ntg-context@ntg.nl; Sun, 19 Feb 2012 14:50: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 ; Sun, 19 Feb 2012 14:50:01 +0100 Original-Received: from netuse by 83.68.239.197 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Feb 2012 14:50:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 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: 05GzNO3i3 - 2ed0d7036e5b - 20120219 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 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:74582 Archived-At: 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 = figures.get("used", "pages", 0) context(numpages) \stopluacode \stoptext 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 ___________________________________________________________________________________