On 07/20/11 13:21, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
> Hello,
> 
> this question in not straightly related to Context, but Context users
> may have solved it and Ctx may be used to solve it.
> 
> I would need to get the following information from .pdf file(s):
> 
> - number of pages,
> - common width and height of pages (provided that they are the same;
> otherwise the dimension can be e.g. zero).

There is the macro \getfiguredimensions which, amongst other things,
sets up \noffigurepages, \figurewidth, and \figureheight.

Here is an excerpt from a macro I have been using since 'forever':

\newcount\imgcount % to store the number of pages

\unexpanded\def\addimage#1{%
  \getfiguredimensions[#1.pdf]%
  \imgcount=\noffigurepages\relax
  \dorecurse
      {\the\imgcount}
      {\getfiguredimensions[#1.pdf][page=\recurselevel]%
       \ifdim\figurewidth>\figureheight
          ...
       \fi }}

Best wishes,
Taco
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to