20 Jul
2011
20 Jul
'11
3:04 p.m.
local MyDocument = lpdf.epdf.load("sometext.pdf")
context.starttext()
local pages = MyDocument.pages local dummy = MyDocument.pages[1] -- we need lua 5.2 in order to avoid this
local nofpages = #MyDocument.pages
context.starttabulate { "|c|c|c|" }
context.NC() context("page") context.NC() context("width") context.NC() context("height") context.NR()
for i=1, nofpages do local page = pages[i] local bbox = page.CropBox or page.MediaBox context.NC() context(i) context.NC() context(bbox[4]-bbox[2]) context.NC() context(bbox[3]-bbox[1]) context.NR() end
context.stoptabulate()
context.stoptext()
This code works perfectly, thank you Hans! Best regards, Lukas