ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: rotating some pages of a pdf
Date: Wed, 4 Jan 2017 22:50:20 +0100	[thread overview]
Message-ID: <75b06718-683e-5b05-06d7-59aabda81438@wxs.nl> (raw)
In-Reply-To: <o4jm40$u40$1@blaine.gmane.org>

On 1/4/2017 9:31 PM, Cesar Romani wrote:
> I'm using the following code, rotate.tex, to rotate all the pages of
> file.pdf, using: context --input=file.pdf --rotation=45 rotate.pdf
>
> rotate.tex
> ==========
> \getfiguredimensions [\getdocumentargument{input}]
> \starttext
>   \dorecurse{\noffigurepages}
>     {\startTEXpage
>       \externalfigure
>         [\getdocumentargument{input}]
>         [page=\recurselevel,
>          orientation=\getdocumentargument{rotation}]
>     \stopTEXpage}
> \stoptext
>
> How could I use this code to rotate, say, the page five, 7º clockwise,
> and the page twenty, 15º counterclockwise?

\starttext

   \dorecurse{\noffigurepages}
     {\startTEXpage
       \doifelsesomething{\getdocumentargument{r\recurselevel}} {%
           \externalfigure
             [\getdocumentargument{input}]
             [page=\recurselevel,
              orientation=\getdocumentargument{r\recurselevel}]
         } {%
           \externalfigure
             [\getdocumentargument{input}]
             [page=\recurselevel,
              orientation=\getdocumentargument{rotation}]
         }%
     \stopTEXpage}

\stoptext


--r5=7 --r20=15 --rotation=45

-----------------------------------------------------------------
                                           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
___________________________________________________________________________________

  reply	other threads:[~2017-01-04 21:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 20:31 Cesar Romani
2017-01-04 21:50 ` Hans Hagen [this message]
2017-01-04 23:34   ` Cesar Romani
2017-01-05  9:14     ` Hans Hagen
2017-01-06  4:47       ` Cesar Romani
2017-01-06 11:02         ` luigi scarso
2017-01-06 15:31         ` Alan Braslau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=75b06718-683e-5b05-06d7-59aabda81438@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).