Debian Codegraph @

texmf-dist/tex/latex/pdfmanagement/colorspace-patches-tmp-ltx.sty

raw
1 %% This is file `colorspace-patches-tmp-ltx.sty"
2 % Copyright (C) 2019-2022 The LaTeX Project
3 %
4 % It may be distributed and/or modified under the conditions of the
5 % LaTeX Project Public License (LPPL), either version 1.3c of this
6 % license or (at your option) any later version. The latest version
7 % of this license is in the file
8 %
9 % https://www.latex-project.org/lppl.txt
10 %
11 % This file is part of the "pdfmanagement bundle" (The Work in LPPL)
12 % and all files in that bundle must be distributed together.
13 %
14 % -----------------------------------------------------------------------
15 %
16 % The development version of the bundle can be found at
17 %
18 % https://github.com/latex3/pdfresources
19 %
20 % for those people who are interested.
21 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
22 \ProvidesExplPackage{colorspace-patches-tmp-ltx}{2026-05-26}{0.97c}
23 {temporary patches for the colorspace package to test pdfresource management ... UF}
24
25
26 % colorspace can define more models, that l3color can't yet handle.
27 \cs_set_protected:Npn \expl@color@set@@nnn #1#2#3
28 {
29 \cs_if_exist:cT { __color_parse_model_ #2 :w }
30 { \color_set:nnn{#1}{#2}{#3} }
31 }
32
33
34 \hook_gput_code:nnn {begindocument} {pdf}
35 {
36 \tl_if_exist:NT \spc@op
37 {
38 \def\spc@Pageresources#1{}
39 }
40 }
41
42 \hook_gput_code:nnn {begindocument/end} {pdf}
43 {
44 \tl_if_exist:NT \spc@op
45 {
46 \pdf_object_new:n {__spc_extgstate_op_false}
47 \pdf_object_write:nnn
48 {__spc_extgstate_op_false}{dict}
49 {/Type /ExtGState~/op~false~/OP~false}
50 \pdfmanagement_add:nnn
51 {Page/Resources/ExtGState}
52 {SPCko}
53 {\pdf_object_ref:n {__spc_extgstate_op_false}}
54 \pdf_object_new:n {__spc_extgstate_op_true0}
55 \pdf_object_write:nnn
56 {__spc_extgstate_op_true0}{dict}
57 {/Type /ExtGState~/op~true~/OP~true~/OPM~0}%
58 \pdfmanagement_add:nnn
59 {Page/Resources/ExtGState}
60 {SPCmz}
61 {\pdf_object_ref:n {__spc_extgstate_op_true0}}
62 \pdf_object_new:n {__spc_extgstate_op_true1}
63 \pdf_object_write:nnn
64 {__spc_extgstate_op_true1}{dict}
65 {/Type /ExtGState~/op~true~/OP~true~/OPM~1}%
66 \pdfmanagement_add:nnn
67 {Page/Resources/ExtGState}
68 {SPCop}
69 {\pdf_object_ref:n {__spc_extgstate_op_true1}}
70 }
71 }
72
73 \RemoveFromHook{begindocument}[colorspace]
74
75 \hook_gput_code:nnn {begindocument/end} {pdf}
76 {
77 \def\spc@elt#1#2
78 {
79 \str_set_eq:Nc\l_tmpa_str {spc@ir@#2}
80 \seq_set_split:NnV \l_tmpa_seq {~}\l_tmpa_str
81 \seq_get_left:NN\l_tmpa_seq\l_tmpa_str
82 %remove spaces
83 \exp_args:NNe
84 \str_replace_all:Nnn\l_tmpa_str {\c_hash_str20}{~}
85 %remove slash
86 \str_set:Ne\l_tmpa_str{\str_tail:N\l_tmpa_str}
87 \pdfmanagement_add:nee
88 {Page/Resources/ColorSpace}{\l_tmpa_str}{\seq_item:Nn\l_tmpa_seq{2}~0~R}
89 }
90 \spc@csall
91 }
92
93 \endinput