You just need to work a little harder.
\startbuffer[1]
This is a test
\stopbuffer
\startbuffer[2]
Another test
\stopbuffer
\startbuffer[3]
And again
\stopbuffer
\startluacode
userdata = userdata or {}
function userdata.shift(i)
return "(" .. i .. "cm ," .. i .. "cm )"
end
function userdata.buffers(i)
local idx = string.format("%s",i)
local b = buffers.data[idx]
if b then
if type(b) == "table" then
return table.concat(b)
else
return b
end
else
return "unknown"
end
end
function userdata.draw_buffer(i)
return "draw btex " .. userdata.buffers(i) .. " etex shifted ".. userdata.shift(i) .. ";"
end
\stopluacode
\starttext
\startluacode
context.startMPpage({offset = "1ex", width = [[\paperwidth]], height = [[\paperheight]]})
for i = 1,3 do
context(userdata.draw_buffer(i))
end
context.stopMPpage()
\stopluacode
\stoptext