summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/back-pdf.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/back-pdf.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/back-pdf.mkiv55
1 files changed, 32 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/context/base/back-pdf.mkiv b/Master/texmf-dist/tex/context/base/back-pdf.mkiv
index 2d3ba85248b..a10afd5b901 100644
--- a/Master/texmf-dist/tex/context/base/back-pdf.mkiv
+++ b/Master/texmf-dist/tex/context/base/back-pdf.mkiv
@@ -29,7 +29,7 @@
\pdfpkresolution = 600
\pdfdecimaldigits = 10
\pdfinclusionerrorlevel = 0
-\pdfminorversion = 5
+\pdfminorversion = 6 % maybe even 7
%pdfuniqueresname = 1
%D This one can be consulted by users although the suffix is also
@@ -44,13 +44,13 @@
%D These are the only official methods to add stuff to the resources.
-\def\pdfbackendsetcatalog #1#2{\ctxlua{lpdf.addtocatalog ("#1",\!!bs#2\!!es)}} \newtoks\pdfcatalog
-\def\pdfbackendsetinfo #1#2{\ctxlua{lpdf.addtoinfo ("#1",\!!bs#2\!!es)}} \newtoks\pdfinfo
-\def\pdfbackendsetname #1#2{\ctxlua{lpdf.addtonames ("#1",\!!bs#2\!!es)}} \newtoks\pdfnames
+\def\pdfbackendsetcatalog #1#2{\ctxlua{lpdf.addtocatalog ("#1",\!!bs#2\!!es)}}
+\def\pdfbackendsetinfo #1#2{\ctxlua{lpdf.addtoinfo ("#1",\!!bs#2\!!es)}}
+\def\pdfbackendsetname #1#2{\ctxlua{lpdf.addtonames ("#1",\!!bs#2\!!es)}}
-\def\pdfbackendsetpageattribute #1#2{\ctxlua{lpdf.addtopageattributes ("#1",\!!bs#2\!!es)}} \newtoks\pdfpageresources
-\def\pdfbackendsetpagesattribute#1#2{\ctxlua{lpdf.addtopagesattributes("#1",\!!bs#2\!!es)}} \newtoks\pdfpageattr
-\def\pdfbackendsetpageresource #1#2{\ctxlua{lpdf.addtopageresources ("#1",\!!bs#2\!!es)}} \newtoks\pdfpagesattr
+\def\pdfbackendsetpageattribute #1#2{\ctxlua{lpdf.addtopageattributes ("#1",\!!bs#2\!!es)}}
+\def\pdfbackendsetpagesattribute#1#2{\ctxlua{lpdf.addtopagesattributes("#1",\!!bs#2\!!es)}}
+\def\pdfbackendsetpageresource #1#2{\ctxlua{lpdf.addtopageresources ("#1",\!!bs#2\!!es)}}
\def\pdfbackendsetextgstate #1#2{\ctxlua{lpdf.adddocumentextgstate ("#1",lpdf.verbose(\!!bs#2\!!es))}}
\def\pdfbackendsetcolorspace #1#2{\ctxlua{lpdf.adddocumentcolorspace("#1",lpdf.verbose(\!!bs#2\!!es))}}
@@ -59,27 +59,33 @@
\def\pdfbackendcurrentresources {\ctxlua{lpdf.collectedresources()}}
+%D Let's block these:
+
+\let\pdfcatalog \relax \newtoks\pdfcatalog
+\let\pdfinfo \relax \newtoks\pdfinfo
+\let\pdfnames \relax \newtoks\pdfnames
+\let\pdfpageresources\relax \newtoks\pdfpageresources
+\let\pdfpageattr \relax \newtoks\pdfpageattr
+\let\pdfpagesattr \relax \newtoks\pdfpagesattr
+
%D An example of usage is:
-\appendtoks % will change ...
- \pdfbackendsetinfo{ConTeXt.Version}{(\contextversion)}%
- \pdfbackendsetinfo{ConTeXt.Time} {(\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}%
- \pdfbackendsetinfo{ConTeXt.Jobname}{(\jobname)}%
- \pdfbackendsetinfo{ConTeXt.Url} {(www.pragma-ade.com)}%
+\appendtoks
+ \pdfbackendsetinfo{ConTeXt.Version}{\contextversion}%
+ \pdfbackendsetinfo{ConTeXt.Time} {\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute}%
+ \pdfbackendsetinfo{ConTeXt.Jobname}{\jobname}%
+ \pdfbackendsetinfo{ConTeXt.Url} {www.pragma-ade.com}%
\to \everylastbackendshipout
%D Unfortunately this is still needed (also for \METAPOST\ to
%D \PDF\ converter):
-\def\doresetmapfilelist
- {\global\let\doresetmapfilelist\relax
- \pdfmapfile{original-empty.map}}
-
-\def\doloadmapfile #1#2{\pdfmapfile{#1#2}}
-\def\doloadmapline #1#2{\pdfmapline{#1#2}}
-
-\appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryxform
-\appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryximage
+% \def\doresetmapfilelist
+% {\global\let\doresetmapfilelist\relax
+% \pdfmapfile{original-empty.map}}
+%
+% \appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryxform
+% \appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryximage
%D Transformations. Some day we will use primitives (once they're fixed).
@@ -101,7 +107,7 @@
\def\dostartmirroring{\pdfliteral{-1 0 0 1 0 0 cm}}
\def\dostopmirroring {\pdfliteral{-1 0 0 1 0 0 cm}}
-\def\dostartclipping#1#2#3% todo
+\def\dostartclipping#1#2#3% todo (still needed?)
{\PointsToBigPoints{#2}\width
\PointsToBigPoints{#3}\height
\grabMPclippath{#1}{1}\width\height{0 0 m \width\space 0 l \width \height l 0 \height l}%
@@ -115,7 +121,7 @@
\appendtoks \ctxlua{backends.codeinjections.finalizepage ()}\to \everybackendshipout % is immediate
\appendtoks \ctxlua{backends.codeinjections.finalizedocument()}\to \everylastbackendshipout % is immediate
-%D Temporary hack, will be removed or improved.
+%D Temporary hack, will be removed or improved or default.
\def\TransparencyHack{\ctxlua{backends.codeinjections.addtransparencygroup()}}
@@ -159,8 +165,11 @@
{\dogetobjectreferencepage{#1}{#2}#3%
\doPDFgetpagereference{\ifx#3\empty\realfolio\else#3\fi}#3}
+\let\lastpredefinedsymbol\empty % some day we can do more at the lua end
+
\def\predefinesymbol[#1]%
{\begingroup
+ \xdef\lastpredefinedsymbol{#1}%
\settightobject{SYM}{#1}\hbox{\symbol[#1]}% to be checked ... maybe only fitting
\dogetobjectreference{SYM}{#1}\lastref
\ctxlua{backends.codeinjections.registersymbol("#1",\lastref)}%