From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/98836 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Pdf info with Lua/Ctx API Date: Wed, 16 Aug 2017 13:57:50 +0200 Message-ID: <5994333E.8030507@gmail.com> References: <2b0ca8a5-f92a-234f-387a-8b99d7a2d5e8@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6986191162505516947==" X-Trace: blaine.gmane.org 1502884708 30161 195.159.176.226 (16 Aug 2017 11:58:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 16 Aug 2017 11:58:28 +0000 (UTC) User-Agent: Postbox 5.0.16 (Macintosh/20170718) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 16 13:58:24 2017 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhwxn-0007Pc-JT for gctc-ntg-context-518@m.gmane.org; Wed, 16 Aug 2017 13:58:19 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 34BEDFA0B0F; Wed, 16 Aug 2017 13:58:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E_IuGjSaQtu0; Wed, 16 Aug 2017 13:58:05 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 7A639FA0B13; Wed, 16 Aug 2017 13:58:05 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C3374FA0B13 for ; Wed, 16 Aug 2017 13:58:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d7rq5wVhw0Vf for ; Wed, 16 Aug 2017 13:58:03 +0200 (CEST) Original-Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id EC157FA0B0F for ; Wed, 16 Aug 2017 13:57:53 +0200 (CEST) Original-Received: by mail-wr0-f169.google.com with SMTP id m57so13572301wrm.5 for ; Wed, 16 Aug 2017 04:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=mxTBPKJq4HOToNW9jX0THvZZAAyX7CiJ8ZJBMhAMa+s=; b=YYuZ9F5aWHnR89B5Cob7+qw4UsNf0VPN65lQ7S4GMyWxCWofOhNab+MKHTn08uw/i1 Pht4owU5KWClFtjCkMx1Bhqk9EVCa3AooAkpNbyPvXSFph8JEfwBOyir3WlTexc5Gx8B /7MQIBBTB9Ac7x1U+FNK+IpIwG3n1p9e0mYpturjyoE5eoCspVKNoKQY4JgD3mkrRbpY pIGz6dO6rH2WvOZA1oTse3ghgnSYBeb1ycZX55YHl9JUv7zNA0Fo66qMTgbMpXDR/YtO hgNVb5QUjggvzll1KtXymdtqoHy7niYwEdjzKTlRb1Uj0kgSULIsnYPe/leiVWO5AnXM PqoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=mxTBPKJq4HOToNW9jX0THvZZAAyX7CiJ8ZJBMhAMa+s=; b=cgnjPcdMF9WDobbkY0GbFTEnUuMSkd6eyFrtBkdG+gDGxWy/nk/oG+oq+JFtBbdEnV 9lMYVbF9ucY95ujTjt1+g/Dfv7jlO1dh9XYL/7GmOfPRE75BVKUanNbSyi+jVxLGLz6/ c9Cg4/5rHoUShXZ+E6z/6jKaZjDPzVoLFYC/hyiaZjsHReq66Q4cignCD2F5EuxEYFpE IX03kHPLH6+wybPXixJY5qfYjxbVNGdAvLBLXPOi3MIT2ApnVXIfrPBp8X5Bmtdzmfh5 PL8n+yjFZQCqbzsj1ilOxHU02f/QwVAKy3ZOw+5LKP0iaXcSn2LXjg6u985Cf8t3QPX9 AtQg== X-Gm-Message-State: AHYfb5hFoihER2AgRMy32Dj6H377+pFzbiKSl3DZmViXtia8lDYCiIDT BOcSkAsC9EQk/Tods/M= X-Received: by 10.223.199.143 with SMTP id l15mr1057583wrg.243.1502884673387; Wed, 16 Aug 2017 04:57:53 -0700 (PDT) Original-Received: from [192.168.1.5] (x4dbd4641.dyn.telefonica.de. [77.189.70.65]) by smtp.gmail.com with ESMTPSA id m136sm1138978wmb.18.2017.08.16.04.57.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 04:57:52 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:98836 Archived-At: This is a multi-part message in MIME format. --===============6986191162505516947== Content-Type: multipart/alternative; boundary="------------010109080406020906040106" This is a multi-part message in MIME format. --------------010109080406020906040106 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > Procházka Lukáš Ing. > 16. August 2017 um 12:11 > Hello Hans, > > thank you for implementation 'figures.getinfo()'; two points: > > 1. Code: > > ---- > \startluacode > > local n = > "x:/Users/MMi/Akce/I-6_Krusovice.DSP-ZDS/Admin/Jednani/2017-07-07-SU-Rakovnik/ZJ.pdf" > > local d = figures.getinfo(n) > ... > ---- > > prints (probably to-string converted) resulting table: > > " > close source > level 3, order 8, name > 'd://Lukas/ConTeXt/Styles/PxLetter.sty' > table={ > ["request"]={ > ["arguments"]=false, > ["cache"]=false, > ["color"]=false, > ["controls"]=false, > ["conversion"]=false, > ["display"]=false, > ["format"]=false, > ["height"]=false, > ["label"]=false, > ["mask"]=false, > > ["name"]="x:/Users/MMi/Akce/I-6_Krusovice.DSP-ZDS/Admin/Jednani/2017-07-07-SU-Rakovnik/ZJ.pdf", > > ... > }, > ["status"]={ > ... > }, > ["used"]={ > ["colordepth"]=0, > ["depth"]=0, > ["format"]="pdf", > > ["fullname"]="x:/Users/MMi/Akce/I-6_Krusovice.DSP-ZDS/Admin/Jednani/2017-07-07-SU-Rakovnik/ZJ.pdf", > > ["height"]=55380991, > ... > }, > } > " > > - Is it intend? Or residual debugging status? > > > 2. Is there a Ctx built-in converter which would convert width and > height (e.g. here: ["height"]=55380991) from "height units" to > milimeters? \starttext \startluacode local length = "55380991" context(number.topoints(length)) context.par() context(number.todimen(length,"pt")) \stopluacode \stoptext Wolfgang --------------010109080406020906040106 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
16. August 2017 um 12:11
Hello Hans,

thank you for implementation 'figures.getinfo()'; two points:

1. Code:

----
\startluacode

local n = "x:/Users/MMi/Akce/I-6_Krusovice.DSP-ZDS/Admin/Jednani/2017-07-07-SU-Rakovnik/ZJ.pdf"
local d = figures.getinfo(n)
...
----

prints (probably to-string converted) resulting table:

"
close source    > level 3, order 8, name 'd://Lukas/ConTeXt/Styles/PxLetter.sty'
table={
 ["request"]={
  ["arguments"]=false,
  ["cache"]=false,
  ["color"]=false,
  ["controls"]=false,
  ["conversion"]=false,
  ["display"]=false,
  ["format"]=false,
  ["height"]=false,
  ["label"]=false,
  ["mask"]=false,
  ["name"]="x:/Users/MMi/Akce/I-6_Krusovice.DSP-ZDS/Admin/Jednani/2017-07-07-SU-Rakovnik/ZJ.pdf",
...
 },
 ["status"]={
...
 },
 ["used"]={
  ["colordepth"]=0,
  ["depth"]=0,
  ["format"]="pdf",
  ["fullname"]="x:/Users/MMi/Akce/I-6_Krusovice.DSP-ZDS/Admin/Jednani/2017-07-07-SU-Rakovnik/ZJ.pdf",
  ["height"]=55380991,
...
 },
}
"

- Is it intend? Or residual debugging status?


2. Is there a Ctx built-in converter which would convert width and height (e.g. here: ["height"]=55380991) from "height units" to milimeters?
\starttext

\startluacode

local length = "55380991"

context(number.topoints(length))

context.par()

context(number.todimen(length,"pt"))

\stopluacode

\stoptext

Wolfgang
--------------010109080406020906040106-- --===============6986191162505516947== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============6986191162505516947==--