# [NTG-context] Clipping multiple PDFs

Pablo Rodriguez oinos at gmx.es
Tue Aug 23 17:57:49 CEST 2022

On 8/22/22 17:46, Jethro Djan via ntg-context wrote:
> Thanks for the solution Pablo. It works well.

> I wanted to add more pdfs (which also has many pages) and found it
> was easier for me to reason in the lua side of things. This is what I
> have at the moment:

I think this might be what you intend:

\setuplayout[page]
\starttext
\doloopoverlist{ass1,ass2,ass3,ass4,ass5,ass6,ass7,ass8}
{\def\Doc{\recursestring.pdf}
\getfiguredimensions[\Doc]
\dorecurse{\noffigurepages}
{\externalfigure[\Doc]
[page=\recurselevel, width=20cm, scale=950]}}
\stoptext

> I didn’t know how to get an array (or indexed table or whatever you
> call it) in ConTeXt/Tex.

\doloopoverlist & \recursestring are your friends here.

> My problem is now with context(context.noffigurepages). Am I calling
> it wrong? All I want to do is call \noffigurepages from the lua side.
> Is there something I am missing?

The approach is totally different: "getnofpages"