diff options
Diffstat (limited to 'tex/context/base/lpdf-mis.lua')
-rw-r--r-- | tex/context/base/lpdf-mis.lua | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/tex/context/base/lpdf-mis.lua b/tex/context/base/lpdf-mis.lua index 521266ad4..345b9624e 100644 --- a/tex/context/base/lpdf-mis.lua +++ b/tex/context/base/lpdf-mis.lua @@ -17,7 +17,7 @@ if not modules then modules = { } end modules ['lpdf-mis'] = { local next, tostring = next, tostring local format, gsub, formatters = string.format, string.gsub, string.formatters -local texset = tex.set +local texset, texget = tex.set, tex.get local backends, lpdf, nodes = backends, lpdf, nodes @@ -259,26 +259,21 @@ local pagespecs = { local pagespec, topoffset, leftoffset, height, width, doublesided = "default", 0, 0, 0, 0, false local cropoffset, bleedoffset, trimoffset, artoffset = 0, 0, 0, 0 -local pdfpaperheight = tex.normalpageheight -- we use normal because one never knows if an user -local pdfpaperwidth = tex.normalpagewidth -- defines a dimen is defined that overloads the internal - function codeinjections.setupcanvas(specification) local paperheight = specification.paperheight local paperwidth = specification.paperwidth local paperdouble = specification.doublesided if paperheight then texset('global','pageheight',paperheight) - pdfpaperheight = paperheight end if paperwidth then texset('global','pagewidth',paperwidth) - pdfpaperwidth = paperwidth end pagespec = specification.mode or pagespec topoffset = specification.topoffset or 0 leftoffset = specification.leftoffset or 0 - height = specification.height or pdfpaperheight - width = specification.width or pdfpaperwidth + height = specification.height or texget("pageheight") + width = specification.width or texget("pagewidth") -- cropoffset = specification.cropoffset or 0 trimoffset = cropoffset - (specification.trimoffset or 0) @@ -334,7 +329,7 @@ local function documentspecification() }) end addtoinfo ("Trapped", pdfconstant("False")) -- '/Trapped' in /Info, 'Trapped' in XMP - addtocatalog("Version", pdfconstant(format("1.%s",tex.pdfminorversion))) + addtocatalog("Version", pdfconstant(format("1.%s",pdf.getminorversion()))) end -- temp hack: the mediabox is not under our control and has a precision of 4 digits @@ -348,9 +343,9 @@ end local function pagespecification() local llx = leftoffset - local lly = pdfpaperheight + topoffset - height + local lly = texget("pageheight") + topoffset - height local urx = width - leftoffset - local ury = pdfpaperheight - topoffset + local ury = texget("pageheight") - topoffset -- boxes can be cached local function extrabox(WhatBox,offset,always) if offset ~= 0 or always then |