ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* checking whether file is landscape or portrait
@ 2020-01-28 15:51 Pablo Rodriguez
  2020-01-28 16:04 ` Taco Hoekwater
  2020-01-28 16:15 ` Wolfgang Schuster
  0 siblings, 2 replies; 9+ messages in thread
From: Pablo Rodriguez @ 2020-01-28 15:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have to check whether an external PDF document is portrait or
landscape (in order to manipulate it in different ways).

From what I understand of grph-inc.mkiv, I came with the following sample:

    \unprotect
    \def\figureXSize{\clf_figurestatus{width}{}}
    \def\figureYSize{\clf_figurestatus{height}{}}
    \protect

    \setupexternalfigures[location=default]
    \starttext
    \getfiguredimensions[cow.pdf]
    \figuresize\\
    \figurelabel\\
    \figureXSize\\
    \figureYSize\\
    \ifnum\figureXSize<\figureYSize portrait\else landscape\fi
    \stoptext

I feel bad of abusing the ConTeXt source in such a miserable way. But
I’m afraid this is the best I can.

Is there no standard way to check portrait or landscape on a given
figure? A conditional for that would be useful.

At least, I would like to know how to get image dimension numbers
suitable to be deployed with \ifnum.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-01-30 12:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28 15:51 checking whether file is landscape or portrait Pablo Rodriguez
2020-01-28 16:04 ` Taco Hoekwater
2020-01-28 16:39   ` Pablo Rodriguez
2020-01-28 16:46   ` Wolfgang Schuster
2020-01-28 16:15 ` Wolfgang Schuster
2020-01-28 16:43   ` Pablo Rodriguez
2020-01-29 13:31     ` Arthur Reutenauer
2020-01-29 15:44       ` Pablo Rodriguez
2020-01-30 12:08         ` context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).