summaryrefslogtreecommitdiff
path: root/tex/context/base/lpdf-pdx.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/lpdf-pdx.mkiv')
-rw-r--r--tex/context/base/lpdf-pdx.mkiv58
1 files changed, 11 insertions, 47 deletions
diff --git a/tex/context/base/lpdf-pdx.mkiv b/tex/context/base/lpdf-pdx.mkiv
index 738cb3f58..cd13ba24c 100644
--- a/tex/context/base/lpdf-pdx.mkiv
+++ b/tex/context/base/lpdf-pdx.mkiv
@@ -13,55 +13,19 @@
\writestatus{loading}{ConTeXt Backend Macros / PDF-X}
-\unprotect
-
-% declare default color space
-% all device based entries of the same CS are mapped to the defined ICCprofile then;
-% i.e. /DeviceRGB --> /ICCBased RGB profile
-% TODO: allow multiple default profiles (one per CS)
-%
-% external ICC profile dictionary (PDF/X-4p and PDF/X-5p)
-%
-% - ProfileName (not file name!)
-% - URLs (array containing at least one URL); the keyword FSA is wrong!
-% - CheckSum (16byte MD5 hash)
-% - ProfileCS (GRAY,RGB,CMYK)
-% - ICCVersion (bytes 8..11 from the header of the ICC profile, as a hex string)
-
\registerctxluafile{lpdf-pdx}{1.001}
-\def\douseinternalICCprofile[#1]%
- {\getparameters[\??ic][colorspace=,filename=,#1]%
- \ctxlua{backends.codeinjections.useinternalICCprofile(
- "\@@iccolorspace","\@@icfilename")}}
-
-% create a dictionary for an external ICC profile (PDF/X-4p and PDF/X-5pg only)
-% the referenced ICC profile is not embedded
-
-\def\douseexternalICCprofile[#1]%
- {\getparameters[\??ic][colorspace=,name=,url=,checksum=,version=,#1]%
- \ctxlua{backends.codeinjections.useexternalICCprofile(
- "\@@iccolorspace","\@@icname","\@@icurl","\@@icchecksum","\@@icversion")}}
-
-% use an ICC profile as default colorspace for all device dependend colors;
-% all device based entries of the same CS are mapped to the defined ICCprofile then;
-% i.e. /DeviceRGB --> /ICCBased RGB profile; always embed the profile!
-
-\def\douseICCdefaultprofile[#1]%
- {\getparameters[\??ic][colorspace=,filename=,#1]%
- \ctxlua{backends.codeinjections.useICCdefaultprofile(
- "\@@iccolorspace","\@@icfilename")}}
-
-% embedding rules for output intent profile differ for the PDF/X versions
-
-\def\dousePDFXoutputintent[#1]%
- {\getparameters[\??ic][reference=\v!yes,outputcondition=,info=,id=,name=,#1]%
- \ctxlua{backends.codeinjections.usePDFXoutputintent(
- "\@@icid","\@@icname","\@@icreference","\@@icoutputcondition","\@@icinfo")}}
+\unprotect
-\def\useinternalICCprofile{\dosingleempty\douseinternalICCprofile}
-\def\useexternalICCprofile{\dosingleempty\douseexternalICCprofile}
-\def\useICCdefaultprofile {\dosingleempty\douseICCdefaultprofile }
-\def\usePDFXoutputintent {\dosingleempty\dousePDFXoutputintent }
+\appendtoks
+ \doifsomething{\backendparameter\c!format}
+ {\ctxlua{backends.codeinjections.setformat {
+ format = "\backendparameter\c!format",
+ level = "\backendparameter\c!level",
+ option = "\backendparameter\c!option",
+ profile = "\backendparameter\c!profile",
+ intent = "\backendparameter\c!intent",
+ }}}%
+\to \everysetupbackend
\protect \endinput