Import AND PLACE Pages of PDF onto Sheet

I’m looking for some help developing a script to import pages of pdfs onto sheets. The max will be 8 per sheet, so I’d have to ensure you can input a page range each time it’s run (1-8, etc.)

I’ve found this for importing images onto a sheet, but only in a column.

But I will need the script to make two rows so it’s 2x4 pdf pages on a sheet like this:

The script I currently use just imports pages, and still requires manual placement:

If you use the column graph, but set the X value to have a similar range and utilize cross product lacing on the point creation you should be all set.

How would I go about setting it up to create the 2 rows of 4 as well? Would I have to split the script into 1-4 and 5-8 or could it be done all at once?

Look into the list lacing demo of the Dynamo primer, as this includes a demo showing cross product lacing to build rows and columns.

I am doing a similar thing, but I want each instance of the PDF to be a different page. When I do the cross product lacing, I get a grid, but the PDF page is repeated ten times up and over. Is there a way to make it so that a 10 page PDF gets laid out in two rows of five for example?

Likely, yes. Would need you to post your work so far as well as a dataset for such.