1if not modules then modules = { } end modules ['lpdf-eng'] = {
2 version = 1.001,
3 optimize = true,
4 comment = "companion to lpdf-ini.mkiv",
5 author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
6 copyright = "PRAGMA ADE / ConTeXt Development Team",
7 license = "see context related readme files"
8}
9
10
11
12
13local codeinjections = backends.pdf.codeinjections
14local imgnew = img.new
15
16function codeinjections.newimage(specification)
17 if type(specification) == "table" then
18 specification.kind = nil
19 end
20 return imgnew(specification)
21end
22
23codeinjections.copyimage = img.copy
24codeinjections.scanimage = img.scan
25codeinjections.embedimage = img.immediatewrite
26codeinjections.wrapimage = img.node
27
28
29
30
31
32
33
34
35
36
37local unpack = unpack
38local sortedkeys = table.sortedkeys
39local context = context
40
41img = table.setmetatableindex (
42 {
43 new = images.create,
44 },
45 {
46
47 scan = images.scan,
48 copy = images.copy,
49 node = images.wrap,
50 write = function(specification) context(images.wrap(specification)) end,
51 immediatewrite = images.embed,
52 immediatewriteobject = function() end,
53 boxes = function() return sortedkeys(images.sizes) end,
54 fields = function() return images.keys end,
55 types = function() return { unpack(images.types,0,#images.types) } end,
56 }
57)
58
59
60
61do
62
63 local function prepare(driver)
64 if not environment.initex then
65
66 updaters.apply("backend.update.pdf")
67
68 updaters.apply("backend.update.lpdf")
69
70 updaters.apply("backend.update.tex")
71
72 updaters.apply("backend.update")
73
74 end
75 end
76
77 local function outputfilename(driver)
78 if not filename then
79 filename = addsuffix(tex.jobname,"pdf")
80 end
81 return filename
82 end
83
84 drivers.install {
85 name = "pdf",
86 flushers = {
87
88 },
89 actions = {
90 convert = drivers.converters.engine,
91 outputfilename = outputfilename,
92 prepare = prepare,
93 },
94 }
95
96end
97
98 |