On 2/7/2022 10:12 PM, Gerhard Schramm via ntg-context wrote:
Dear Hraban, Dear Hans
I'm looking for a way to automatically rotate a graphic
(DIN_A4_PDF_Pages). I try to manage technical manuals with Context.
(Which is really great!) To do this, I have to import always new
PDF-pages (technical sketches) , which can be in landscape or portrait
format. The pages should always be displayed as large as possible on the
pages of my manuals. (I have no influence on the PDF's, as they come
from other departments.) Do you see a possibility here? kind regards Gerd
\starttext
\showframe
\starttexdefinition MaxFigure #1#2
\page
\getfiguredimensions[#1][page=#2]\relax
\ifdim\figurewidth>\figureheight\relax
\externalfigure
[#1]
[page=#2,
frame=on,
orientation=90,
width=\textheight]
\else
\externalfigure
[#1]
[page=#2,
frame=on,
height=\textheight]
\fi
\page
\stoptexdefinition
\MaxFigure{math.pdf}{1}
\MaxFigure{math.pdf}{2}
\stoptext
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________