summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/back-imp-pdf.lmt
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-10-19 00:16:55 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-10-19 00:16:55 +0200
commit9d2ad7dea5c20379f6679c57c3b16752b1af445a (patch)
tree45f39853be982c52f7386b968cf4f15f1f70ccce /tex/context/base/mkxl/back-imp-pdf.lmt
parent6ca88e6f1f15cea89db047839c3126a501f39eea (diff)
downloadcontext-9d2ad7dea5c20379f6679c57c3b16752b1af445a.tar.gz
2021-10-18 23:13:00
Diffstat (limited to 'tex/context/base/mkxl/back-imp-pdf.lmt')
-rw-r--r--tex/context/base/mkxl/back-imp-pdf.lmt49
1 files changed, 49 insertions, 0 deletions
diff --git a/tex/context/base/mkxl/back-imp-pdf.lmt b/tex/context/base/mkxl/back-imp-pdf.lmt
new file mode 100644
index 000000000..a57427e66
--- /dev/null
+++ b/tex/context/base/mkxl/back-imp-pdf.lmt
@@ -0,0 +1,49 @@
+if not modules then modules = { } end modules ['back-imp-pdf'] = {
+ version = 1.001,
+ comment = "companion to back-imp-pdf.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- We hide the pdf table from users so that we can guarantee no interference with
+-- the way we manage resources, info, etc. Users should use the \type {lpdf}
+-- interface instead. For now we have a little for tikz. If really needed some more
+-- can be made accessible but it has to happen in a controlled way then, for
+-- instance by first loading or enabling some compatibility layer so that we can
+-- trace possible interferences.
+
+updaters.register("backends.pdf.latebindings",function()
+ --
+ local dummy = function() end
+ local report = logs.reporter("backend")
+ --
+ -- For now we keep this for tikz. If really needed some more can be made
+ -- accessible but it has to happen in a controlled way then, for instance
+ -- by first loading or enabling some compatibility layer so that we can
+ -- trace possible interferences.
+ --
+ pdf = {
+ immediateobj = lpdf.immediateobject
+ }
+
+ table.setmetatableindex(pdf,function(t,k)
+ report("calling unavailable pdf.%s function",k)
+ t[k] = dummy
+ return dummy
+ end)
+
+end)
+
+-- The compression setter is defined here because it's probably the only macro
+-- that is used independent of a driver being chosen. It's easier this way than
+-- checking in other ways unless we add some generic compression setting to
+-- all drivers.
+
+interfaces.implement {
+ name = "setpdfcompression",
+ arguments = { "integer", "integer" },
+ actions = lpdf.setcompression,
+}
+
+-- The pdf driver itself is installed in lpdf-lmt.lmt!