ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
To: jethro Reuel via ntg-context <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: Re: Clipping multiple PDFs
Date: Sun, 21 Aug 2022 18:41:51 +0200	[thread overview]
Message-ID: <562590a3-0a27-ffb2-e76f-a5491bcbed8e@gmx.es> (raw)
In-Reply-To: <F0CA4E7B-6922-4C74-97AA-4F267F893DEE@gmail.com>

On 8/18/22 02:13, jethro Reuel via ntg-context wrote:
> Hello,
>
> I am trying to put multiple PDF’s that were typeset differently into
> one document without modifying the individual files themselves.
> [...]
> The problem is the original page numbers show and I’d prefer that it
> did not. So I thought maybe I could clip all the page numbers from
> every page (since they are all in the same position across all the
> pages) but I don’t know how to do this with the \clip command. Any
> ideas? I already tried using \input but it gives some weird output in
> some places. It doesn’t have to use this method as long as it does
> what I need it to do.

Hi Jethro,

it works using \clip with \externalfigure inside a loop (\dorecurse).

With \getfiguredimensions you get the number of pages of each PDF
document (\noffigurepages).

The following source both generates the source PDF document and the
imposed result with clipped pages (just to see a sample of the commands
mentioned above):

  \startbuffer[newbuff]
  \setuppapersize[A3]
  \setupbodyfont[sans, 1200pt]
  \starttext
  \dorecurse{8}
  {\startmakeup[page][pagestate=start, align=center, style=\bf]
    \recurselevel
   \stopmakeup}
  \stoptext
  \stopbuffer
  \startmode[*first]
  \savebuffer[newbuff][source_page.tex, prefix=no]
  \executesystemcommand{context --purgeall source_page.tex}
  \stopmode
  \setuplayout[page]
  \setuppapersize[A6][A4]
  \setuppaper[nx=2, ny=2]
  \setuparranging [XY]
  \starttext
  \startnotmode[*first]
  \def\Doc{source_page.pdf}
  \getfiguredimensions[\Doc]
  \dorecurse{\noffigurepages}
    {\clip[hoffset=96mm, voffset=136mm, width=105mm, height=148mm]
        {\externalfigure[\Doc][page=\recurselevel]}}
  \stopnotmode
  \stoptext

Just in case it might help,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2022-08-21 16:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18  0:13 jethro Reuel via ntg-context
2022-08-21 16:41 ` Pablo Rodriguez via ntg-context [this message]
2022-08-22 15:46   ` Jethro Djan via ntg-context
2022-08-23 15:57     ` Pablo Rodriguez via ntg-context
2022-08-23 17:12       ` Jethro Djan via ntg-context
2022-08-23 17:50         ` Pablo Rodriguez via ntg-context
2022-08-22 15:43 Jethro Djan via ntg-context
2022-08-23 15:27 ` Aditya Mahajan via ntg-context
2022-08-23 17:38   ` Pablo Rodriguez via ntg-context
2022-08-23 17:47     ` Aditya Mahajan via ntg-context
2022-08-22 15:44 Jethro Djan via ntg-context

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=562590a3-0a27-ffb2-e76f-a5491bcbed8e@gmx.es \
    --to=ntg-context@ntg.nl \
    --cc=oinos@gmx.es \
    /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).