On 6-1-2010 2:33, Zhichu Chen wrote:
Hi,
I've written a very old module which used a lot of pdf primitives like \pdfescapehex and \pdfescapename etc. and it turns out not they don't work in mkiv. So I just want to know are there any alternatives?
just lua code as placeholders for primitives will not show up in context mkiv \startluacode local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes local gsub, format, byte = string.gsub, string.format, string.byte function commands.hexify(str) texsprint(ctxcatcodes,(gsub(str,".",function(s) return format("%0X",byte(s)) end))) end \stopluacode \long\def\hexify#1{\ctxlua{commands.hexify([[#1]])}} \hexify{I wonder why this is needed.} btw, if your old module produces pdf and uses other \pdf... primitives it's unlikely to work with mkiv anyway so you'd better check if it's still needed Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------