From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/70179 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?B?UHJvY2jhemthIEx1a+G5IEluZy4gLSBQb250ZXggcy4gci4gby4=?= Newsgroups: gmane.comp.tex.context Subject: Re: OT: Pdf info Date: Wed, 20 Jul 2011 15:04:15 +0200 Message-ID: References: <20110720120200.199120@gmx.net> <4E26CFD0.1030805@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1311167088 31986 80.91.229.12 (20 Jul 2011 13:04:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Jul 2011 13:04:48 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Jul 20 15:04:37 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 1QjWS0-0000hT-7k for gctc-ntg-context-518@m.gmane.org; Wed, 20 Jul 2011 15:04:32 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 159F5CAE53; Wed, 20 Jul 2011 15:04:31 +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 jFeOY3r7Gdkv; Wed, 20 Jul 2011 15:04:26 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 970ECCAE4B; Wed, 20 Jul 2011 15:04:26 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AFE18CAE4B for ; Wed, 20 Jul 2011 15:04: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 PLydSYJFBGzx for ; Wed, 20 Jul 2011 15:04:20 +0200 (CEST) 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 85310CAE47 for ; Wed, 20 Jul 2011 15:04:20 +0200 (CEST) Original-Received: from mail.pontex.cz (mail.pontex.cz [89.233.168.98]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p6KD4Jkw029803 for ; Wed, 20 Jul 2011 15:04:19 +0200 Original-Received: from localhost ([127.0.0.1]) by mail.pontex.cz (Kerio MailServer 6.6.2) for ntg-context@ntg.nl; Wed, 20 Jul 2011 15:04:17 +0200 In-Reply-To: <4E26CFD0.1030805@wxs.nl> User-Agent: Opera Mail/11.50 (Win32) X-Bayes-Prob: 0.0003 (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: 05Fad4jFg - 94d8a63a3a8c - 20110720 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.216 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:70179 Archived-At: > local MyDocument = lpdf.epdf.load("sometext.pdf") > > context.starttext() > > local pages = MyDocument.pages > local dummy = MyDocument.pages[1] -- we need lua 5.2 in order to > avoid this > > local nofpages = #MyDocument.pages > > context.starttabulate { "|c|c|c|" } > > context.NC() context("page") > context.NC() context("width") > context.NC() context("height") context.NR() > > for i=1, nofpages do > local page = pages[i] > local bbox = page.CropBox or page.MediaBox > context.NC() context(i) > context.NC() context(bbox[4]-bbox[2]) > context.NC() context(bbox[3]-bbox[1]) context.NR() > end > > context.stoptabulate() > > context.stoptext() This code works perfectly, thank you Hans! Best regards, Lukas ___________________________________________________________________________________ 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 ___________________________________________________________________________________