summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/lpdf-grp.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-09-30 20:33:04 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-09-30 20:33:04 +0200
commite3ad6b783e6162de6dad5531299e69c3d3079b9c (patch)
tree5b78f96f02bd8eb4b784484aa720930959afa404 /tex/context/base/mkiv/lpdf-grp.lua
parentd6c24a529d922ac67d2a30595c52b6b9547dce77 (diff)
downloadcontext-e3ad6b783e6162de6dad5531299e69c3d3079b9c.tar.gz
2018-09-30 19:42:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-grp.lua')
-rw-r--r--tex/context/base/mkiv/lpdf-grp.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/lpdf-grp.lua b/tex/context/base/mkiv/lpdf-grp.lua
index 34925fddd..ee6aa5d84 100644
--- a/tex/context/base/mkiv/lpdf-grp.lua
+++ b/tex/context/base/mkiv/lpdf-grp.lua
@@ -252,6 +252,14 @@ end
-- temp hack
+local f_image = formatters["%.6F 0 0 %.6F 0 0 cm /%s Do"]
+local f_pattern = formatters["q /Pattern cs /%s scn 0 0 %.6F %.6F re f Q"] -- q Q is not really needed
+
+directives.register("pdf.stripzeros",function()
+ f_image = formatters["%.6N 0 0 %.6N 0 0 cm /%s Do"]
+ f_pattern = formatters["q /Pattern cs /%s scn 0 0 %.6N %.6N re f Q"]
+end)
+
function img.package(image) -- see lpdf-u3d **
local boundingbox = image.bbox
local imagetag = "Im" .. image.index
@@ -270,7 +278,7 @@ function img.package(image) -- see lpdf-u3d **
local height = boundingbox[4]
local xform = img.scan {
attr = resources(),
- stream = formatters["%.6F 0 0 %.6F 0 0 cm /%s Do"](width,height,imagetag),
+ stream = f_image(width,height,imagetag),
bbox = { 0, 0, width/basepoints, height/basepoints },
}
img.immediatewrite(xform)
@@ -280,7 +288,6 @@ end
-- experimental
local nofpatterns = 0
-local f_pattern = formatters["q /Pattern cs /%s scn 0 0 %.6F %.6F re f Q"] -- q Q is not really needed
local texsavebox = tex.saveboxresource