| 1 |
%% |
| 2 |
%% This is file `pdfmanagement.ltx', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% pdfmanagement.dtx (with options: `header') |
| 8 |
%% l3pdfdict.dtx (with options: `package') |
| 9 |
%% l3pdfmanagement.dtx (with options: `package') |
| 10 |
%% ltdocinit.dtx (with options: `package') |
| 11 |
%% l3pdfannot.dtx (with options: `package') |
| 12 |
%% l3pdfxform.dtx (with options: `package') |
| 13 |
%% l3pdfmeta.dtx (with options: `package') |
| 14 |
%% l3pdftools.dtx (with options: `package') |
| 15 |
%% l3pdffile.dtx (with options: `package') |
| 16 |
%% l3pdfoutline.dtx (with options: `package') |
| 17 |
%% |
| 18 |
%% Copyright (C) 2019-2026 The LaTeX Project |
| 19 |
%% |
| 20 |
%% It may be distributed and/or modified under the conditions of |
| 21 |
%% the LaTeX Project Public License (LPPL), either version 1.3c of |
| 22 |
%% this license or (at your option) any later version. The latest |
| 23 |
%% version of this license is in the file: |
| 24 |
%% |
| 25 |
%% https://www.latex-project.org/lppl.txt |
| 26 |
%% |
| 27 |
%% This file is part of the "LaTeX PDF management bundle" (The Work in LPPL) |
| 28 |
%% and all files in that bundle must be distributed together. |
| 29 |
%% |
| 30 |
%% File: pdfmanagement.dtx |
| 31 |
\ProvidesExplFile{pdfmanagement.ltx}{2026-05-26}{0.97c} |
| 32 |
{PDF~management~code} |
| 33 |
%% File: l3pdfdict.dtx |
| 34 |
\cs_new:Npn \__pdfdict_get_type:n #1 |
| 35 |
{ |
| 36 |
\str_case_e:nn { \str_head:n{#1} } |
| 37 |
{ |
| 38 |
{g}{global} |
| 39 |
{l}{local} |
| 40 |
} |
| 41 |
} |
| 42 |
\msg_new:nnn { pdfdict } { show-dict } |
| 43 |
{ %#1: name of the dictionary |
| 44 |
%#2: expanded content |
| 45 |
%#3: type |
| 46 |
The~#3~dictionary~'#1'~ |
| 47 |
\tl_if_empty:nTF {#2} |
| 48 |
{ is~empty \\>~ . } |
| 49 |
{ contains~the~pairs~(without~outer~braces): #2 . } |
| 50 |
} |
| 51 |
\msg_new:nnn { pdfdict } { unknown-dict } |
| 52 |
{ |
| 53 |
The~dictionary~'#1'~is~unknown. |
| 54 |
} |
| 55 |
\msg_new:nnn { pdfdict } { dict-already-defined } |
| 56 |
{ |
| 57 |
The~#2~dictionary~'#1'~is~already~defined. |
| 58 |
} |
| 59 |
\msg_new:nnn { pdfdict } { empty-value } |
| 60 |
{ The~value~#1~for~#2~is~blank~and~will~be~ignored } |
| 61 |
|
| 62 |
\msg_new:nnn { pdfdict } { invalid-name } |
| 63 |
{ Name~'#1'~is~not~valid\\ |
| 64 |
Names~of~dictionaries~should~start~with~'g_'~or~'l_' } |
| 65 |
|
| 66 |
|
| 67 |
\seq_new:N \g__pdfdict_lnames_seq |
| 68 |
\seq_new:N \g__pdfdict_gnames_seq |
| 69 |
\cs_new:Npn \__pdfdict_name:n #1 % #1 dictionary name |
| 70 |
{ |
| 71 |
\str_head:n{#1}__pdfdict_/#1_prop |
| 72 |
} |
| 73 |
\cs_set_eq:NN \__kernel_pdfdict_name:n \__pdfdict_name:n |
| 74 |
|
| 75 |
\cs_new_protected:Npn \__pdfdict_new:n #1 |
| 76 |
{ |
| 77 |
\__pdfdict_if_exist:nTF { #1 } |
| 78 |
{ |
| 79 |
\msg_error:nnee |
| 80 |
{ pdfdict } |
| 81 |
{ dict-already-defined } |
| 82 |
{ \tl_to_str:n {#1} } |
| 83 |
{ \__pdfdict_get_type:n{#1} } |
| 84 |
} |
| 85 |
{ |
| 86 |
\str_case_e:nnF { \str_head:n{#1} } |
| 87 |
{ |
| 88 |
{g} |
| 89 |
{ |
| 90 |
\prop_new:c { \__pdfdict_name:n { #1 } } |
| 91 |
\seq_gput_right:cn {g__pdfdict_gnames_seq} { #1 } |
| 92 |
} |
| 93 |
{l} |
| 94 |
{ |
| 95 |
\prop_new:c { \__pdfdict_name:n { #1 } } |
| 96 |
\seq_gput_right:cn {g__pdfdict_lnames_seq} { #1 } |
| 97 |
} |
| 98 |
} |
| 99 |
{ |
| 100 |
\msg_error:nne{pdfdict}{invalid-name}{\tl_to_str:n{#1}} |
| 101 |
} |
| 102 |
} |
| 103 |
} |
| 104 |
|
| 105 |
\cs_set_eq:NN \pdfdict_new:n \__pdfdict_new:n |
| 106 |
\cs_new_protected:Npn \__pdfdict_set_eq:nn #1 #2 |
| 107 |
{ |
| 108 |
\__pdfdict_if_exist:nTF { #2 } |
| 109 |
{ |
| 110 |
\__pdfdict_if_exist:nF { #1 } |
| 111 |
{ |
| 112 |
\__pdfdict_new:n { #1 } |
| 113 |
} |
| 114 |
\prop_set_eq:cc { \__pdfdict_name:n {#1} }{ \__pdfdict_name:n {#2} } |
| 115 |
} |
| 116 |
{ |
| 117 |
\msg_error:nnn { pdfdict } { unknown-dict } { #1 } |
| 118 |
} |
| 119 |
} |
| 120 |
|
| 121 |
\cs_set_eq:NN \pdfdict_set_eq:nn \__pdfdict_set_eq:nn |
| 122 |
|
| 123 |
\cs_new_protected:Npn \__pdfdict_gset_eq:nn #1 #2 |
| 124 |
{ |
| 125 |
\__pdfdict_if_exist:nTF { #2 } |
| 126 |
{ |
| 127 |
\__pdfdict_if_exist:nF { #1 } |
| 128 |
{ |
| 129 |
\__pdfdict_new:n { #1 } |
| 130 |
} |
| 131 |
\prop_gset_eq:cc { \__pdfdict_name:n {#1} }{ \__pdfdict_name:n {#2} } |
| 132 |
} |
| 133 |
{ |
| 134 |
\msg_error:nnn { pdfdict } { unknown-dict } { #1 } |
| 135 |
} |
| 136 |
} |
| 137 |
|
| 138 |
\cs_set_eq:NN \pdfdict_gset_eq:nn \__pdfdict_gset_eq:nn |
| 139 |
\prg_new_conditional:Npnn \__pdfdict_if_exist:n #1 { p , T , F , TF } |
| 140 |
{ |
| 141 |
\prop_if_exist:cTF |
| 142 |
{ \__pdfdict_name:n { #1 } } |
| 143 |
{ \prg_return_true: } |
| 144 |
{ \prg_return_false: } |
| 145 |
} |
| 146 |
\prg_set_eq_conditional:NNn |
| 147 |
\pdfdict_if_exist:n \__pdfdict_if_exist:n { p , T , F , TF } |
| 148 |
\prg_new_conditional:Npnn \__pdfdict_if_empty:n #1 { p , T , F , TF } |
| 149 |
{ |
| 150 |
\prop_if_empty:cTF |
| 151 |
{ \__pdfdict_name:n { #1 } } |
| 152 |
{ \prg_return_true: } |
| 153 |
{ \prg_return_false: } |
| 154 |
} |
| 155 |
|
| 156 |
\prg_set_eq_conditional:NNn |
| 157 |
\pdfdict_if_empty:n \__pdfdict_if_empty:n { p , T , F , TF } |
| 158 |
\cs_new_protected:Npn \__pdfdict_put:nnn #1 #2 #3 %#1 (local) dict, #2 name, #3 value |
| 159 |
{ |
| 160 |
\tl_if_blank:nTF { #3 } |
| 161 |
{ |
| 162 |
\msg_warning:nnnn { pdfdict }{ empty-value }{ #2 } { #1 } |
| 163 |
} |
| 164 |
{ |
| 165 |
\__pdfdict_if_exist:nTF { #1 } |
| 166 |
{ |
| 167 |
\exp_args:Nne \prop_put:cnn |
| 168 |
{ \__pdfdict_name:n { #1 } }{ \str_convert_pdfname:n { #2 } } { #3 } |
| 169 |
} |
| 170 |
{ |
| 171 |
\msg_error:nnn { pdfdict } { unknown-dict } { #1 } |
| 172 |
} |
| 173 |
} |
| 174 |
} |
| 175 |
|
| 176 |
\cs_set_eq:NN \pdfdict_put:nnn \__pdfdict_put:nnn |
| 177 |
\cs_generate_variant:Nn \pdfdict_put:nnn {nne,nno,nee,nnx} |
| 178 |
|
| 179 |
\cs_new_protected:Npn \__pdfdict_gput:nnn #1 #2 #3 %#1 global dict, #2 name, #3 value |
| 180 |
{ |
| 181 |
\tl_if_empty:nTF { #3 } |
| 182 |
{ |
| 183 |
\msg_warning:nnnn { pdfdict }{ empty-value }{ #2 } { #1 } |
| 184 |
} |
| 185 |
{ |
| 186 |
\__pdfdict_if_exist:nTF { #1 } |
| 187 |
{ |
| 188 |
\exp_args:Nne \prop_gput:cnn |
| 189 |
{ \__pdfdict_name:n { #1 } }{ \str_convert_pdfname:n { #2 } } { #3 } |
| 190 |
} |
| 191 |
{ |
| 192 |
\msg_error:nnn { pdfdict } { unknown-dict } { #1 } |
| 193 |
} |
| 194 |
} |
| 195 |
} |
| 196 |
|
| 197 |
\cs_set_eq:NN \pdfdict_gput:nnn \__pdfdict_gput:nnn |
| 198 |
\cs_generate_variant:Nn \pdfdict_gput:nnn {nne,nno,nee,nnx} |
| 199 |
\cs_new_protected:Npn \__pdfdict_get:nnN #1 #2 #3 %dict,key,macro |
| 200 |
{ |
| 201 |
\__pdfdict_if_exist:nTF { #1 } |
| 202 |
{ |
| 203 |
\exp_args:Nne \prop_get:cnN |
| 204 |
{ \__pdfdict_name:n { #1 } } |
| 205 |
{ \str_convert_pdfname:n { #2 } } #3 |
| 206 |
} |
| 207 |
{ |
| 208 |
\msg_error:nnn { pdfdict } { unknown-dict } { #1 } |
| 209 |
} |
| 210 |
} |
| 211 |
|
| 212 |
\cs_set_eq:NN \pdfdict_get:nnN \__pdfdict_get:nnN |
| 213 |
\cs_new_protected:Npn \__pdfdict_remove:nn #1 #2 %dict,name |
| 214 |
{ |
| 215 |
\__pdfdict_if_exist:nTF { #1 } |
| 216 |
{ |
| 217 |
\exp_args:Nne \prop_remove:cn |
| 218 |
{ \__pdfdict_name:n { #1 } }{ \str_convert_pdfname:n { #2 } } |
| 219 |
} |
| 220 |
{ |
| 221 |
\msg_error:nnn { pdfdict } { unknown-dict } { #1 } |
| 222 |
} |
| 223 |
} |
| 224 |
\cs_set_eq:NN \pdfdict_remove:nn \__pdfdict_remove:nn |
| 225 |
|
| 226 |
\cs_new_protected:Npn \__pdfdict_gremove:nn #1 #2 %dict,name |
| 227 |
{ |
| 228 |
\__pdfdict_if_exist:nTF { #1 } |
| 229 |
{ |
| 230 |
\exp_args:Nne \prop_gremove:cn |
| 231 |
{ \__pdfdict_name:n { #1 } }{ \str_convert_pdfname:n { #2 } } |
| 232 |
} |
| 233 |
{ |
| 234 |
\msg_error:nnn { pdfdict } { unknown-dict } { #1 } |
| 235 |
} |
| 236 |
} |
| 237 |
|
| 238 |
\cs_set_eq:NN \pdfdict_gremove:nn \__pdfdict_gremove:nn |
| 239 |
\cs_new_protected:Npn \__pdfdict_show:Nn #1#2 %#1 message command, #2 dict |
| 240 |
{ |
| 241 |
\prop_if_exist:cTF { \__pdfdict_name:n { #2 } } |
| 242 |
{ |
| 243 |
#1 |
| 244 |
{ pdfdict } |
| 245 |
{ show-dict } |
| 246 |
{ \tl_to_str:n {#2} } |
| 247 |
{ \prop_map_function:cN {\__pdfdict_name:n { #2 }} \msg_show_item:nn } |
| 248 |
{ \__pdfdict_get_type:n{#2} } |
| 249 |
{ } |
| 250 |
} |
| 251 |
{ |
| 252 |
#1 { pdfdict } { unknown-dict } { #2 } {}{}{} |
| 253 |
} |
| 254 |
} |
| 255 |
\cs_new_protected:Npn \pdfdict_show:n #1 |
| 256 |
{ |
| 257 |
\__pdfdict_show:Nn \msg_show:nneeee {#1} |
| 258 |
} |
| 259 |
\cs_new:Npn \__pdfdict_item:nn #1 #2 %#1 name, #2 value |
| 260 |
{ |
| 261 |
\tl_if_blank:nF {#2} { /#1~#2~ } |
| 262 |
} |
| 263 |
\cs_generate_variant:Nn \__pdfdict_item:nn {ne} |
| 264 |
\cs_set_eq:NN \pdfdict_item:nn \__pdfdict_item:nn |
| 265 |
\cs_generate_variant:Nn \pdfdict_item:nn {ne} |
| 266 |
\cs_new:Npn \__pdfdict_use:n #1 %#1 dict |
| 267 |
{ |
| 268 |
\prop_map_function:cN { \__pdfdict_name:n { #1 } } \__pdfdict_item:ne |
| 269 |
} |
| 270 |
|
| 271 |
\cs_set_eq:NN \pdfdict_use:n \__pdfdict_use:n |
| 272 |
%% File: l3pdfmanagement.dtx |
| 273 |
|
| 274 |
|
| 275 |
\msg_new:nnn { pdfmanagement } { unknown-dict } |
| 276 |
{ The~PDF~management~resource~'#1'~is~unknown. } |
| 277 |
|
| 278 |
\msg_new:nnn { pdfmanagement } { empty-value } |
| 279 |
{ The~value~for~#1~is~empty~and~will~be~ignored } |
| 280 |
|
| 281 |
\msg_new:nnn { pdfmanagement } { no-removal } |
| 282 |
{ It~is~not~possible~to~remove~values~from~'#1'.} |
| 283 |
|
| 284 |
\msg_new:nnn { pdfmanagement } { no-show } |
| 285 |
{ It~is~not~possible~to~show~the~content~of~'#1'.} |
| 286 |
|
| 287 |
\msg_new:nnn { pdfmanagement } { name-exist } |
| 288 |
{ The~name~'#1'~has~already~been~used~for~name~tree~'#2'.} |
| 289 |
|
| 290 |
\msg_new:nnn { pdfmanagement } { show-dict } |
| 291 |
{ |
| 292 |
The~PDF~resource~'#1'~ |
| 293 |
\tl_if_empty:nTF {#2} |
| 294 |
{ is~empty \\>~ . } |
| 295 |
{ contains~the~pairs~(without~outer~braces): #2 . } |
| 296 |
} |
| 297 |
\msg_new:nnn { pdfmanagement } { dict-already-defined } |
| 298 |
{ |
| 299 |
The~path~'#1'~is~already~defined. |
| 300 |
} |
| 301 |
\msg_new:nnn { pdfmanagement } { inactive } |
| 302 |
{ |
| 303 |
The~PDF~resources~management~is~not~active\\ |
| 304 |
command~'#1'~ignored. |
| 305 |
} |
| 306 |
\tl_new:N \l__pdfmanagement_tmpa_tl |
| 307 |
\tl_new:N \l__pdfmanagement_tmpb_tl |
| 308 |
\seq_new:N \l__pdfmanagement_tmpa_seq |
| 309 |
|
| 310 |
\bool_new:N \g__pdfmanagement_active_bool |
| 311 |
\bool_gset_true:N \g__pdfmanagement_active_bool |
| 312 |
\prg_new_conditional:Npnn \__pdfmanagement_if_active: { p , T , F , TF } |
| 313 |
{ |
| 314 |
\prg_return_true: |
| 315 |
} |
| 316 |
\prg_set_eq_conditional:NNn |
| 317 |
\pdfmanagement_if_active: \__pdfmanagement_if_active: { p , T , F , TF } |
| 318 |
|
| 319 |
\cs_set_eq:NN \IfPDFManagementActiveTF\use_i:nn |
| 320 |
\hook_new:n {pdfmanagement/add} |
| 321 |
\cs_new_protected:Npn \pdfmanagement_add:nnn #1 #2 #3 |
| 322 |
{ |
| 323 |
\pdfdict_if_exist:nTF { g__pdf_Core/#1 } |
| 324 |
{ |
| 325 |
\hook_gput_code:nnn |
| 326 |
{pdfmanagement/add} |
| 327 |
{pdfmanagement} |
| 328 |
{ |
| 329 |
\__pdfmanagement_handler_gput:nnn { #1 }{ #2 }{ #3 } |
| 330 |
} |
| 331 |
} |
| 332 |
{ |
| 333 |
\msg_error:nnn{pdfmanagement}{unknown-dict}{#1} |
| 334 |
} |
| 335 |
} |
| 336 |
|
| 337 |
\cs_generate_variant:Nn \pdfmanagement_add:nnn {nne,nee,eee,nnx,nxx,xxx} |
| 338 |
\cs_set_eq:NN \PDFManagementAdd \pdfmanagement_add:eee |
| 339 |
\tl_new:N \g__kernel_pdfmanagement_thispage_shipout_code_tl |
| 340 |
\tl_new:N \g__kernel_pdfmanagement_lastpage_shipout_code_tl |
| 341 |
\tl_new:N \g__kernel_pdfmanagement_end_run_code_tl |
| 342 |
\tl_gset:Nn \g__kernel_pdfmanagement_thispage_shipout_code_tl |
| 343 |
{ |
| 344 |
\exp_args:NV \__pdf_backend_ThisPage_gpush:n { \g_shipout_readonly_int } |
| 345 |
\exp_args:NV \__pdf_backend_PageResources_gpush:n { \g_shipout_readonly_int } |
| 346 |
} |
| 347 |
|
| 348 |
\tl_gset:Nn \g__kernel_pdfmanagement_end_run_code_tl |
| 349 |
{ |
| 350 |
\__pdf_backend_PageResources_obj_gpush: %ExtGState etc |
| 351 |
\__pdfmanagement_Pages_gpush: %pagesattr |
| 352 |
\__pdfmanagement_Info_gpush: %pdfinfo |
| 353 |
\__pdfmanagement_Catalog_gpush: |
| 354 |
} |
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
\cs_new_protected:Npn \__pdfmanagement_handler_gput:nnn #1 #2 #3 %#1 dict, #2 name, #3 value |
| 359 |
{ |
| 360 |
\tl_if_empty:nTF { #3 } |
| 361 |
{ |
| 362 |
\msg_none:nnn { pdfmanagement }{ empty-value }{ /#1/#2 } |
| 363 |
} |
| 364 |
{ |
| 365 |
\pdfdict_if_exist:nTF { g__pdf_Core/#1 } |
| 366 |
{ |
| 367 |
\cs_if_exist:cTF |
| 368 |
{ __pdfmanagement_handler/#1/?_gput:nn } %general, name independent handler |
| 369 |
{ \use:c {__pdfmanagement_handler/#1/?_gput:nn} {#2} {#3} } |
| 370 |
{ |
| 371 |
\cs_if_exist:cTF |
| 372 |
{ __pdfmanagement_handler/#1/#2_gput:n } |
| 373 |
{ \use:c {__pdfmanagement_handler/#1/#2_gput:n} {#3} } %special handler |
| 374 |
{ |
| 375 |
\exp_args:Nne |
| 376 |
\prop_gput:cnn |
| 377 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/#1 } } |
| 378 |
{ \str_convert_pdfname:n { #2 } } |
| 379 |
{ #3 } |
| 380 |
} |
| 381 |
} |
| 382 |
} |
| 383 |
{ |
| 384 |
\msg_error:nnn { pdfmanagement } { unknown-dict } { #1 } |
| 385 |
} |
| 386 |
} |
| 387 |
} |
| 388 |
|
| 389 |
\cs_generate_variant:Nn \__pdfmanagement_handler_gput:nnn {nee} |
| 390 |
|
| 391 |
\cs_new_protected:Npn \__pdfmanagement_get:nnN #1 #2 #3 %path,key,macro |
| 392 |
{ |
| 393 |
\exp_args:Nne |
| 394 |
\prop_get:cnN |
| 395 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/#1 } } |
| 396 |
{ \str_convert_pdfname:n {#2} } #3 |
| 397 |
} |
| 398 |
|
| 399 |
\cs_new_protected:Npn \__pdfmanagement_handler_gremove:nn #1 #2 %path,key |
| 400 |
{ |
| 401 |
\pdfdict_if_exist:nTF { g__pdf_Core/#1 } |
| 402 |
{ |
| 403 |
\cs_if_exist:cTF |
| 404 |
{ __pdfmanagement_handler/#1/?_gremove:n } %general, name independent handler |
| 405 |
{ \use:c {__pdfmanagement_handler/#1/?_gremove:n} {#2} } |
| 406 |
{ |
| 407 |
\cs_if_exist:cTF |
| 408 |
{ __pdfmanagement_handler/#1/#2_gremove: } |
| 409 |
{ \use:c {__pdfmanagement_handler/#1/#2_gremove:} } %special handler |
| 410 |
{ |
| 411 |
\exp_args:Nne |
| 412 |
\prop_gremove:cn |
| 413 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/#1 } } |
| 414 |
{ \str_convert_pdfname:n {#2} } |
| 415 |
} |
| 416 |
} |
| 417 |
} |
| 418 |
{ |
| 419 |
\msg_error:nnn { pdfmanagement } { unknown-dict } { #1 } |
| 420 |
} |
| 421 |
} |
| 422 |
|
| 423 |
\cs_new_protected:Npn \__pdfmanagement_gremove:nn #1 #2 %path,key |
| 424 |
{ |
| 425 |
\pdfdict_if_exist:nTF { g__pdf_Core/#1 } |
| 426 |
{ |
| 427 |
\exp_args:Nne |
| 428 |
\prop_gremove:cn |
| 429 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/#1 } } |
| 430 |
{ \str_convert_pdfname:n{#2} } |
| 431 |
} |
| 432 |
{ |
| 433 |
\msg_error:nnn { pdfmanagement } { unknown-dict } { #1 } |
| 434 |
} |
| 435 |
} |
| 436 |
|
| 437 |
\cs_new_protected:Npn \__pdfmanagement_show:Nn #1#2 |
| 438 |
{ |
| 439 |
\cs_if_exist:cTF |
| 440 |
{ __pdfmanagement_handler/#2/?_show: } %general, name independent handler |
| 441 |
{ \use:c {__pdfmanagement_handler/#2/?_show:} } |
| 442 |
{ |
| 443 |
\prop_if_exist:cTF { \__kernel_pdfdict_name:n { g__pdf_Core/#2 } } |
| 444 |
{ |
| 445 |
#1 |
| 446 |
{ pdfmanagement } { show-dict } |
| 447 |
{ \tl_to_str:n {#2} } |
| 448 |
{ |
| 449 |
\prop_map_function:cN |
| 450 |
{\__kernel_pdfdict_name:n { g__pdf_Core/#2 }} |
| 451 |
\msg_show_item:nn |
| 452 |
} |
| 453 |
{ } { } |
| 454 |
} |
| 455 |
{ |
| 456 |
#1 { pdfmanagement } { unknown-dict } {#2}{}{}{} |
| 457 |
} |
| 458 |
} |
| 459 |
} |
| 460 |
|
| 461 |
\cs_new_protected:Npn \__pdfmanagement_show:n #1 %path |
| 462 |
{ |
| 463 |
\prop_show:c { \__kernel_pdfdict_name:n { g__pdf_Core/#1 } } |
| 464 |
} |
| 465 |
\cs_new_protected:Npn \pdfmanagement_show:n #1 |
| 466 |
{ |
| 467 |
\__pdfmanagement_show:Nn \msg_show:nneeee {#1} |
| 468 |
} |
| 469 |
\cs_new_protected:Npn \pdfmanagement_remove:nn #1 #2 |
| 470 |
{ |
| 471 |
\pdfdict_if_exist:nTF { g__pdf_Core/#1 } |
| 472 |
{ |
| 473 |
\__pdfmanagement_handler_gremove:nn { #1 }{ #2 } |
| 474 |
} |
| 475 |
{ |
| 476 |
\msg_error:nnn{pdfmanagement}{unknown-dict}{#1} |
| 477 |
} |
| 478 |
} |
| 479 |
\cs_new_protected:Npn \pdfmanagement_get:nnN #1 #2 #3 |
| 480 |
{ |
| 481 |
\pdfdict_if_exist:nTF { g__pdf_Core/#1 } |
| 482 |
{ |
| 483 |
\__pdfmanagement_get:nnN { #1 }{ #2 } #3 |
| 484 |
} |
| 485 |
{ |
| 486 |
\msg_error:nnn{pdfmanagement}{unknown-dict}{#1} |
| 487 |
} |
| 488 |
} |
| 489 |
\pdfdict_new:n { g__pdf_Core/Info} |
| 490 |
\cs_new_protected:Npn \__pdfmanagement_Info_gpush: |
| 491 |
{ |
| 492 |
\prop_map_function:cN |
| 493 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Info} } |
| 494 |
\__pdf_backend_info_gput:nn |
| 495 |
\prop_gclear:c { \__kernel_pdfdict_name:n { g__pdf_Core/Info} } |
| 496 |
} |
| 497 |
\pdfdict_new:n { g__pdf_Core/Pages} |
| 498 |
\cs_new_protected:Npn \__pdfmanagement_Pages_gpush: |
| 499 |
{ |
| 500 |
\pdfdict_if_empty:nF { g__pdf_Core/Pages} |
| 501 |
{ |
| 502 |
\exp_args:Ne \__pdf_backend_Pages_primitive:n |
| 503 |
{ |
| 504 |
\pdfdict_use:n { g__pdf_Core/Pages} |
| 505 |
} |
| 506 |
} |
| 507 |
} |
| 508 |
|
| 509 |
\pdfdict_new:n { g__pdf_Core/Page } |
| 510 |
\pdfdict_new:n { g__pdf_Core/ThisPage } |
| 511 |
|
| 512 |
\cs_new_protected:cpn { __pdfmanagement_handler/Page/?_gput:nn } #1 #2 |
| 513 |
{ |
| 514 |
\__pdf_backend_Page_gput:nn { #1 }{ #2 } |
| 515 |
} |
| 516 |
\cs_new_protected:cpn { __pdfmanagement_handler/Page/?_gremove:n } #1 |
| 517 |
{ |
| 518 |
\__pdf_backend_Page_gremove:n { #1 } |
| 519 |
} |
| 520 |
|
| 521 |
\cs_new_protected:cpn { __pdfmanagement_handler/ThisPage/?_gput:nn } #1 #2 |
| 522 |
{ |
| 523 |
\prop_gput:cnn { \__kernel_pdfdict_name:n { g__pdf_Core/ThisPage } }{ #1 } { #2 } |
| 524 |
\__pdf_backend_ThisPage_gput:nn { #1 }{ #2 } |
| 525 |
} |
| 526 |
|
| 527 |
\cs_new_protected:cpn { __pdfmanagement_handler/ThisPage/?_gremove:n } #1 |
| 528 |
{ |
| 529 |
\msg_warning:nnn { pdfmanagement } { no-removal }{ThisPage} |
| 530 |
} |
| 531 |
|
| 532 |
\cs_new_protected:cpn { __pdfmanagement_handler/ThisPage/?_show: } |
| 533 |
{ |
| 534 |
\msg_warning:nnn { pdfmanagement } { no-show }{ThisPage} |
| 535 |
} |
| 536 |
|
| 537 |
\clist_const:Nn \c__pdfmanagement_PageResources_clist |
| 538 |
{ |
| 539 |
ExtGState, |
| 540 |
ColorSpace, |
| 541 |
Pattern, |
| 542 |
Shading, |
| 543 |
} |
| 544 |
|
| 545 |
\clist_map_inline:Nn \c__pdfmanagement_PageResources_clist |
| 546 |
{ |
| 547 |
\pdfdict_new:n { g__pdf_Core/Page/Resources/#1} |
| 548 |
} |
| 549 |
\cs_new_protected:cpn { __pdfmanagement_handler/Page/Resources/ExtGState/?_gput:nn } #1 #2 |
| 550 |
{ |
| 551 |
\__pdf_backend_PageResources_gput:nnn {ExtGState} { #1 }{ #2 } |
| 552 |
} |
| 553 |
|
| 554 |
\cs_new_protected:cpn { __pdfmanagement_handler/Page/Resources/ColorSpace/?_gput:nn } #1 #2 |
| 555 |
{ |
| 556 |
\__pdf_backend_PageResources_gput:nnn {ColorSpace} { #1 }{ #2 } |
| 557 |
} |
| 558 |
|
| 559 |
\cs_new_protected:cpn { __pdfmanagement_handler/Page/Resources/Shading/?_gput:nn } #1 #2 |
| 560 |
{ |
| 561 |
\__pdf_backend_PageResources_gput:nnn {Shading} { #1 }{ #2 } |
| 562 |
} |
| 563 |
|
| 564 |
\cs_new_protected:cpn { __pdfmanagement_handler/Page/Resources/Pattern/?_gput:nn } #1 #2 |
| 565 |
{ |
| 566 |
\__pdf_backend_PageResources_gput:nnn {Pattern} { #1 }{ #2 } |
| 567 |
} |
| 568 |
\pdfdict_new:n { g__pdf_Core/Catalog} |
| 569 |
|
| 570 |
\clist_const:Nn \c__pdfmanagement_Catalog_toplevel_clist |
| 571 |
{ |
| 572 |
Collection, |
| 573 |
DPartRoot, |
| 574 |
Lang, |
| 575 |
Legal, |
| 576 |
Metadata, |
| 577 |
NeedsRendering, |
| 578 |
OCProperties/D, |
| 579 |
OpenAction, |
| 580 |
PageLabels, |
| 581 |
PageLayout, |
| 582 |
PageMode, |
| 583 |
Perms, |
| 584 |
PieceInfo, |
| 585 |
SpiderInfo, |
| 586 |
StructTreeRoot, |
| 587 |
Threads, |
| 588 |
URI, |
| 589 |
Version |
| 590 |
} |
| 591 |
|
| 592 |
\clist_const:Nn \c__pdfmanagement_Catalog_sub_clist |
| 593 |
{ |
| 594 |
AA, |
| 595 |
AcroForm, |
| 596 |
AcroForm/DR, |
| 597 |
AcroForm/DR/Font, |
| 598 |
MarkInfo, |
| 599 |
ViewerPreferences, |
| 600 |
OCProperties |
| 601 |
} |
| 602 |
|
| 603 |
\clist_map_inline:Nn \c__pdfmanagement_Catalog_sub_clist |
| 604 |
{ |
| 605 |
\pdfdict_new:n { g__pdf_Core/Catalog/#1} |
| 606 |
} |
| 607 |
|
| 608 |
\clist_const:Nn \c__pdfmanagement_Catalog_seq_clist |
| 609 |
{ |
| 610 |
AF, |
| 611 |
OCProperties/OCGs, |
| 612 |
OCProperties/Configs, |
| 613 |
OutputIntents, |
| 614 |
Requirements, |
| 615 |
AcroForm/Fields, |
| 616 |
AcroForm/CO |
| 617 |
} |
| 618 |
|
| 619 |
\clist_const:Nn \c__pdfmanagement_Catalog_nametree_clist |
| 620 |
{ |
| 621 |
AP, |
| 622 |
JavaScript, |
| 623 |
} |
| 624 |
\clist_map_inline:Nn \c__pdfmanagement_Catalog_seq_clist |
| 625 |
{ |
| 626 |
\seq_new:c { g__pdfmanagement_/Catalog/#1_seq } % new name later |
| 627 |
\cs_new_protected:cpn { __pdfmanagement_handler/Catalog/#1_gput:n } ##1 |
| 628 |
{ |
| 629 |
\seq_gput_right:cn { g__pdfmanagement_/Catalog/#1_seq } { ##1 } |
| 630 |
} |
| 631 |
} |
| 632 |
|
| 633 |
\cs_new_protected:cpn { __pdfmanagement_handler/Catalog/OCProperties/D_gput:n } #1 |
| 634 |
{ |
| 635 |
\seq_gput_left:cn |
| 636 |
{ g__pdfmanagement_/Catalog/OCProperties/Configs_seq } |
| 637 |
{ #1 } |
| 638 |
} |
| 639 |
\cs_new_protected:Npn \__pdfmanagement_nametree_add_aux:nnn #1 #2 #3 |
| 640 |
%#1 name tree, #2 sanitized name #3 value |
| 641 |
{ |
| 642 |
\prop_get:coNTF |
| 643 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/#1 }} |
| 644 |
{ #2 } |
| 645 |
\l__pdfmanagement_tmpb_tl |
| 646 |
{ |
| 647 |
\msg_error:nnnn{pdfmanagement}{name-exist}{#2}{#1} |
| 648 |
} |
| 649 |
{ |
| 650 |
\prop_gput:con |
| 651 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/#1 }} |
| 652 |
{ #2 } |
| 653 |
{ #3 } |
| 654 |
} |
| 655 |
} |
| 656 |
\clist_map_inline:Nn \c__pdfmanagement_Catalog_nametree_clist |
| 657 |
{ |
| 658 |
\pdfdict_new:n { g__pdf_Core/Catalog/Names/#1} |
| 659 |
\cs_new_protected:cpn { __pdfmanagement_handler/Catalog/Names/#1/?_gput:nn } ##1 ##2 |
| 660 |
{ |
| 661 |
\pdf_string_from_unicode:nnN {utf8/string}{##1}\l__pdfmanagement_tmpa_tl |
| 662 |
\exp_args:Nno |
| 663 |
\__pdfmanagement_nametree_add_aux:nnn {#1}{\l__pdfmanagement_tmpa_tl}{##2} |
| 664 |
} |
| 665 |
} |
| 666 |
\pdfdict_new:n { g__pdf_Core/Catalog/Names/EmbeddedFiles} |
| 667 |
\cs_new_protected:cpn { __pdfmanagement_handler/Catalog/Names/EmbeddedFiles/?_gput:nn } #1 #2 |
| 668 |
{ |
| 669 |
\pdf_string_from_unicode:nnN {utf8/string}{#1}\l__pdfmanagement_tmpa_tl |
| 670 |
\exp_args:Nno |
| 671 |
\__pdfmanagement_nametree_add_aux:nnn |
| 672 |
{EmbeddedFiles}{\l__pdfmanagement_tmpa_tl}{#2} |
| 673 |
\exp_args:No |
| 674 |
\__pdf_backend_NamesEmbeddedFiles_add:nn {\l__pdfmanagement_tmpa_tl}{#2} |
| 675 |
} |
| 676 |
\cs_new_protected:Npn \__pdfmanagement_Catalog_gpush: |
| 677 |
{ |
| 678 |
\use:c { __pdfmanagement_/Catalog/AA_gpush: } |
| 679 |
\use:c { __pdfmanagement_/Catalog/AcroForm_gpush: } |
| 680 |
\use:c { __pdfmanagement_/Catalog/AF_gpush: } |
| 681 |
\use:c { __pdfmanagement_/Catalog/MarkInfo_gpush: } |
| 682 |
\pdfmeta_standard_verify:nT {Catalog_no_OCProperties} |
| 683 |
{ |
| 684 |
\use:c { __pdfmanagement_/Catalog/OCProperties_gpush: } |
| 685 |
} |
| 686 |
\use:c { __pdfmanagement_/Catalog/OutputIntents_gpush: } |
| 687 |
\use:c { __pdfmanagement_/Catalog/Requirements_gpush: } |
| 688 |
\use:c { __pdfmanagement_/Catalog/ViewerPreferences_gpush: } |
| 689 |
% output the single values: |
| 690 |
\prop_map_function:cN |
| 691 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog} } |
| 692 |
\__pdf_backend_catalog_gput:nn |
| 693 |
% output names tree: |
| 694 |
\use:c{ __pdfmanagement_/Catalog/Names_gpush:n } {EmbeddedFiles} |
| 695 |
\clist_map_inline:Nn \c__pdfmanagement_Catalog_nametree_clist |
| 696 |
{ |
| 697 |
\use:c{ __pdfmanagement_/Catalog/Names_gpush:n } {##1} |
| 698 |
} |
| 699 |
} |
| 700 |
\cs_new_protected:cpn { __pdfmanagement_/Catalog/AA_gpush: } |
| 701 |
{ |
| 702 |
\prop_if_empty:cF |
| 703 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AA } } |
| 704 |
{ |
| 705 |
\pdf_object_new:n { __pdfmanagement/Catalog/AA } |
| 706 |
\pdf_object_write:nne |
| 707 |
{ __pdfmanagement/Catalog/AA }{ dict } |
| 708 |
{ \pdfdict_use:n { g__pdf_Core/Catalog/AA } } |
| 709 |
\exp_args:Nne |
| 710 |
\__pdf_backend_catalog_gput:nn |
| 711 |
{AA} |
| 712 |
{ |
| 713 |
\pdf_object_ref:n { __pdfmanagement/Catalog/AA } |
| 714 |
} |
| 715 |
} |
| 716 |
} |
| 717 |
\cs_new_protected:cpn { __pdfmanagement_/Catalog/AcroForm_gpush: } |
| 718 |
{ |
| 719 |
\seq_if_empty:cF { g__pdfmanagement_/Catalog/AcroForm/Fields_seq } |
| 720 |
{ |
| 721 |
\pdf_object_new:n { __pdfmanagement/Catalog/AcroForm/Fields } |
| 722 |
\pdf_object_write:nne |
| 723 |
{ __pdfmanagement/Catalog/AcroForm/Fields } { array } |
| 724 |
{ \seq_use:cn { g__pdfmanagement_/Catalog/AcroForm/Fields_seq } {~} } |
| 725 |
\exp_args:Nnne |
| 726 |
\prop_gput:cnn %we have to use \prop here to avoid the handler ... |
| 727 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm } } |
| 728 |
{ Fields } |
| 729 |
{ \pdf_object_ref:n { __pdfmanagement/Catalog/AcroForm/Fields } } |
| 730 |
} |
| 731 |
\seq_if_empty:cF { g__pdfmanagement_/Catalog/AcroForm/CO_seq } |
| 732 |
{ |
| 733 |
\pdf_object_new:n { __pdfmanagement/Catalog/AcroForm/CO } |
| 734 |
\pdf_object_write:nne |
| 735 |
{ __pdfmanagement/Catalog/AcroForm/CO } { array } |
| 736 |
{ \seq_use:cn { g__pdfmanagement_/Catalog/AcroForm/CO_seq } {~} } |
| 737 |
\exp_args:Nnne |
| 738 |
\prop_gput:cnn %we have to use \prop here to avoid the handler ... |
| 739 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm } } |
| 740 |
{ CO } |
| 741 |
{ \pdf_object_ref:n { __pdfmanagement/Catalog/AcroForm/CO } } |
| 742 |
} |
| 743 |
\prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm/DR/Font}} |
| 744 |
{ |
| 745 |
\pdf_object_new:n { __pdfmanagement/Catalog/AcroForm/DR/Font } |
| 746 |
\pdf_object_write:nne |
| 747 |
{ __pdfmanagement/Catalog/AcroForm/DR/Font } { dict } |
| 748 |
{ \pdfdict_use:n { g__pdf_Core/Catalog/AcroForm/DR/Font } } |
| 749 |
\exp_args:Nnne |
| 750 |
\prop_gput:cnn %we have to use \prop here to avoid the handler ... |
| 751 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm/DR } } |
| 752 |
{ Font } |
| 753 |
{ \pdf_object_ref:n { __pdfmanagement/Catalog/AcroForm/DR/Font } } |
| 754 |
} |
| 755 |
\prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm/DR}} |
| 756 |
{ |
| 757 |
\pdf_object_new:n { __pdfmanagement/Catalog/AcroForm/DR } |
| 758 |
\pdf_object_write:nne |
| 759 |
{ __pdfmanagement/Catalog/AcroForm/DR } { dict } |
| 760 |
{ \pdfdict_use:n { g__pdf_Core/Catalog/AcroForm/DR } } |
| 761 |
\exp_args:Nnne |
| 762 |
\prop_gput:cnn %we have to use \prop here to avoid the handler ... |
| 763 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm } } |
| 764 |
{ DR } |
| 765 |
{ \pdf_object_ref:n { __pdfmanagement/Catalog/AcroForm/DR } } |
| 766 |
} |
| 767 |
\prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm} } |
| 768 |
{ |
| 769 |
\pdf_object_new:n { __pdfmanagement/Catalog/AcroForm } |
| 770 |
\pdf_object_write:nne |
| 771 |
{ __pdfmanagement/Catalog/AcroForm } { dict } |
| 772 |
{ \pdfdict_use:n { g__pdf_Core/Catalog/AcroForm } } |
| 773 |
\exp_args:Nnne |
| 774 |
\__pdfmanagement_handler_gput:nnn |
| 775 |
{ Catalog } |
| 776 |
{ AcroForm } |
| 777 |
{ \pdf_object_ref:n { __pdfmanagement/Catalog/AcroForm } } |
| 778 |
} |
| 779 |
} |
| 780 |
|
| 781 |
\cs_new_protected:cpn { __pdfmanagement_/Catalog/AF_gpush: } |
| 782 |
{ |
| 783 |
\seq_if_empty:cF |
| 784 |
{ g__pdfmanagement_/Catalog/AF_seq } |
| 785 |
{ |
| 786 |
\pdf_object_new:n { __pdfmanagement/Catalog/AF } |
| 787 |
\pdf_object_write:nne |
| 788 |
{ __pdfmanagement/Catalog/AF } { array } |
| 789 |
{ \seq_use:cn { g__pdfmanagement_/Catalog/AF_seq } {~} } |
| 790 |
\exp_args:Nne |
| 791 |
\__pdf_backend_catalog_gput:nn |
| 792 |
{AF} |
| 793 |
{ |
| 794 |
\pdf_object_ref:n {__pdfmanagement/Catalog/AF} |
| 795 |
} |
| 796 |
} |
| 797 |
} |
| 798 |
\cs_new_protected:cpn { __pdfmanagement_/Catalog/MarkInfo_gpush: } |
| 799 |
{ |
| 800 |
\prop_if_empty:cF |
| 801 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/MarkInfo } } |
| 802 |
{ |
| 803 |
\pdf_object_new:n { __pdfmanagement/Catalog/MarkInfo } |
| 804 |
\pdf_object_write:nne |
| 805 |
{ __pdfmanagement/Catalog/MarkInfo } { dict } |
| 806 |
{ \pdfdict_use:n { g__pdf_Core/Catalog/MarkInfo } } |
| 807 |
\exp_args:Nne |
| 808 |
\__pdf_backend_catalog_gput:nn |
| 809 |
{MarkInfo} |
| 810 |
{ |
| 811 |
\pdf_object_ref:n {__pdfmanagement/Catalog/MarkInfo} |
| 812 |
} |
| 813 |
} |
| 814 |
} |
| 815 |
\cs_new_protected:cpn { __pdfmanagement_/Catalog/OCProperties_gpush: } |
| 816 |
{ |
| 817 |
\int_compare:nNnT |
| 818 |
{ |
| 819 |
( \seq_count:c { g__pdfmanagement_/Catalog/OCProperties/OCGs_seq } )* |
| 820 |
( \seq_count:c { g__pdfmanagement_/Catalog/OCProperties/Configs_seq } ) |
| 821 |
} |
| 822 |
> |
| 823 |
{ 0 } |
| 824 |
{ |
| 825 |
\pdf_object_new:n { __pdfmanagement/Catalog/OCProperties } |
| 826 |
\seq_gpop_left:cN { g__pdfmanagement_/Catalog/OCProperties/Configs_seq} \l__pdfmanagement_tmpa_tl |
| 827 |
\pdf_object_write:nne {__pdfmanagement/Catalog/OCProperties} {dict} |
| 828 |
{ |
| 829 |
/OCGs~[ \seq_use:cn { g__pdfmanagement_/Catalog/OCProperties/OCGs_seq } {~} ] |
| 830 |
/D~\l__pdfmanagement_tmpa_tl~ |
| 831 |
\seq_if_empty:cF { g__pdfmanagement_/Catalog/OCProperties/Configs_seq } |
| 832 |
{ |
| 833 |
/Configs~ |
| 834 |
[ \seq_use:cn { g__pdfmanagement_/Catalog/OCProperties/Configs_seq} {~} ] |
| 835 |
} |
| 836 |
} |
| 837 |
\exp_args:Nne |
| 838 |
\__pdf_backend_catalog_gput:nn |
| 839 |
{ OCProperties } |
| 840 |
{ \pdf_object_ref:n {__pdfmanagement/Catalog/OCProperties} } |
| 841 |
} |
| 842 |
} |
| 843 |
\cs_new_protected:cpn { __pdfmanagement_/Catalog/OutputIntents_gpush: } |
| 844 |
{ |
| 845 |
\seq_if_empty:cF |
| 846 |
{ g__pdfmanagement_/Catalog/OutputIntents_seq } |
| 847 |
{ |
| 848 |
\pdf_object_new:n { __pdfmanagement/Catalog/OutputIntents } |
| 849 |
\pdf_object_write:nne |
| 850 |
{ __pdfmanagement/Catalog/OutputIntents } { array } |
| 851 |
{ \seq_use:cn { g__pdfmanagement_/Catalog/OutputIntents_seq } {~} } |
| 852 |
\exp_args:Nne |
| 853 |
\__pdf_backend_catalog_gput:nn |
| 854 |
{OutputIntents} |
| 855 |
{ |
| 856 |
\pdf_object_ref:n {__pdfmanagement/Catalog/OutputIntents} |
| 857 |
} |
| 858 |
} |
| 859 |
} |
| 860 |
\cs_new_protected:cpn { __pdfmanagement_/Catalog/Requirements_gpush: } |
| 861 |
{ |
| 862 |
\seq_if_empty:cF |
| 863 |
{ g__pdfmanagement_/Catalog/Requirements_seq } |
| 864 |
{ |
| 865 |
\pdf_object_new:n { __pdfmanagement/Catalog/Requirements } |
| 866 |
\pdf_object_write:nne |
| 867 |
{ __pdfmanagement/Catalog/Requirements } { array } |
| 868 |
{ \seq_use:cn { g__pdfmanagement_/Catalog/Requirements_seq } {~} } |
| 869 |
\exp_args:Nne |
| 870 |
\__pdf_backend_catalog_gput:nn |
| 871 |
{Requirements} |
| 872 |
{ |
| 873 |
\pdf_object_ref:n { __pdfmanagement/Catalog/Requirements } |
| 874 |
} |
| 875 |
} |
| 876 |
} |
| 877 |
\cs_new_protected:cpn { __pdfmanagement_/Catalog/ViewerPreferences_gpush: } |
| 878 |
{ |
| 879 |
\prop_if_empty:cF |
| 880 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/ViewerPreferences } } |
| 881 |
{ |
| 882 |
\pdf_object_new:n { __pdfmanagement/Catalog/ViewerPreferences } |
| 883 |
\pdf_object_write:nne |
| 884 |
{ __pdfmanagement/Catalog/ViewerPreferences } { dict } |
| 885 |
{ \pdfdict_use:n { g__pdf_Core/Catalog/ViewerPreferences } } |
| 886 |
\exp_args:Nne |
| 887 |
\__pdf_backend_catalog_gput:nn |
| 888 |
{ViewerPreferences} |
| 889 |
{ |
| 890 |
\pdf_object_ref:n {__pdfmanagement/Catalog/ViewerPreferences} |
| 891 |
} |
| 892 |
} |
| 893 |
} |
| 894 |
\int_new:N \g__pdfmanagement_EmbeddedFiles_int |
| 895 |
\cs_new:Npn \__pdfmanagement_EmbeddedFiles_name: |
| 896 |
{ |
| 897 |
( |
| 898 |
l3ef |
| 899 |
\int_compare:nNnT {\g__pdfmanagement_EmbeddedFiles_int} < {10} |
| 900 |
{0} |
| 901 |
\int_compare:nNnT {\g__pdfmanagement_EmbeddedFiles_int} < {100} |
| 902 |
{0} |
| 903 |
\int_compare:nNnT {\g__pdfmanagement_EmbeddedFiles_int} < {1000} |
| 904 |
{0} |
| 905 |
\int_use:N \g__pdfmanagement_EmbeddedFiles_int |
| 906 |
) |
| 907 |
} |
| 908 |
\pdfdict_new:n { g__pdf_Core/Catalog/Names } |
| 909 |
|
| 910 |
\cs_new_protected:cpn { __pdfmanagement_handler/Catalog/Names/EmbeddedFiles_gput:n } #1 |
| 911 |
{ |
| 912 |
\int_gincr:N \g__pdfmanagement_EmbeddedFiles_int |
| 913 |
\exp_args:Nne |
| 914 |
\prop_gput:cnn |
| 915 |
{ \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/EmbeddedFiles }} |
| 916 |
{ \__pdfmanagement_EmbeddedFiles_name: } |
| 917 |
{ #1 } |
| 918 |
\exp_args:Ne |
| 919 |
\__pdf_backend_NamesEmbeddedFiles_add:nn {\__pdfmanagement_EmbeddedFiles_name:} { #1 } |
| 920 |
} |
| 921 |
\cs_new_protected:cpn { __pdfmanagement_/Catalog/Names_gpush:n } #1 %#1 name of name tree |
| 922 |
{ |
| 923 |
\pdfdict_if_empty:nF { g__pdf_Core/Catalog/Names/#1 } |
| 924 |
{ |
| 925 |
\seq_clear:N \l__pdfmanagement_tmpa_seq |
| 926 |
\prop_map_inline:cn |
| 927 |
{\__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/#1 }} |
| 928 |
{ \seq_put_right:Nn \l__pdfmanagement_tmpa_seq {##1~##2}} |
| 929 |
\seq_sort:Nn \l__pdfmanagement_tmpa_seq |
| 930 |
{ |
| 931 |
\str_compare:nNnTF {##1} > {##2} |
| 932 |
{ \sort_return_swapped: } |
| 933 |
{ \sort_return_same: } |
| 934 |
} |
| 935 |
\exp_args:Nne \__pdf_backend_Names_gpush:nn |
| 936 |
{#1} |
| 937 |
{ |
| 938 |
\seq_use:Nn \l__pdfmanagement_tmpa_seq {~} |
| 939 |
} |
| 940 |
} |
| 941 |
} |
| 942 |
\cs_new_protected:cpn {__pdfmanagement_handler/Catalog/?_show:} |
| 943 |
{ |
| 944 |
\iow_term:e |
| 945 |
{ |
| 946 |
\iow_newline: |
| 947 |
The~Catalog~contains~in~the~top~level~the~single~value~entries |
| 948 |
\prop_map_function:cN |
| 949 |
{\__kernel_pdfdict_name:n { g__pdf_Core/Catalog }} |
| 950 |
\msg_show_item:nn |
| 951 |
} |
| 952 |
\clist_map_inline:Nn \c__pdfmanagement_Catalog_seq_clist |
| 953 |
{ |
| 954 |
\seq_if_empty:cF { g__pdfmanagement_/Catalog/##1_seq } |
| 955 |
{ |
| 956 |
\iow_term:e |
| 957 |
{ |
| 958 |
The~'##1'~array~contains~the~entries |
| 959 |
\seq_map_function:cN { g__pdfmanagement_/Catalog/##1_seq } \msg_show_item:n |
| 960 |
} |
| 961 |
} |
| 962 |
} |
| 963 |
\clist_map_inline:Nn \c__pdfmanagement_Catalog_sub_clist |
| 964 |
{ |
| 965 |
\prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/##1 } } |
| 966 |
{ |
| 967 |
\iow_term:e |
| 968 |
{ |
| 969 |
The~Catalog~subdirectory~'##1'~contains~the~single~value~entries |
| 970 |
\prop_map_function:cN |
| 971 |
{\__kernel_pdfdict_name:n { g__pdf_Core/Catalog/##1 }} |
| 972 |
\msg_show_item:nn |
| 973 |
} |
| 974 |
} |
| 975 |
} |
| 976 |
\tl_show:e {\tl_to_str:n{\pdfmanagement_show:n{Catalog}}} |
| 977 |
} |
| 978 |
\pdfdict_new:n { g__pdf_Core/Xform/Resources/Properties} |
| 979 |
%% File: ltdocinit.dtx |
| 980 |
\clist_if_exist:NF \g__pdfmanagement_firstaidoff_clist |
| 981 |
{ \clist_new:N \g__pdfmanagement_firstaidoff_clist } |
| 982 |
\cs_if_exist:NTF\AddToDocumentProperties |
| 983 |
{ |
| 984 |
\cs_new:Npn\pdfmanagement_get_documentproperty:n #1 |
| 985 |
{ |
| 986 |
\prop_item:Nn \g__kernel_documentproperties_prop {#1} |
| 987 |
} |
| 988 |
\prg_new_protected_conditional:Npnn |
| 989 |
\pdfmanagement_get_documentproperty:nN #1#2 { T , F , TF } |
| 990 |
{ |
| 991 |
\prop_get:NnNTF \g__kernel_documentproperties_prop {#1} #2 |
| 992 |
{ |
| 993 |
\prg_return_true: |
| 994 |
} |
| 995 |
{ |
| 996 |
\prg_return_false: |
| 997 |
} |
| 998 |
} |
| 999 |
\cs_new_eq:NN\GetDocumentProperties\GetDocumentProperty |
| 1000 |
\cs_new_eq:NN |
| 1001 |
\pdfmanagement_get_documentproperties:n |
| 1002 |
\pdfmanagement_get_documentproperty:n |
| 1003 |
\prg_new_eq_conditional:NNn |
| 1004 |
\pdfmanagement_get_documentproperties:nN |
| 1005 |
\pdfmanagement_get_documentproperty:nN |
| 1006 |
{ T , F , TF } |
| 1007 |
}% else existence |
| 1008 |
{ |
| 1009 |
\prop_new:N \g__pdfmanagement_documentproperties_prop % |
| 1010 |
\NewDocumentCommand\AddToDocumentProperties{O{\@currname}mm} |
| 1011 |
{ |
| 1012 |
\exp_args:NNe |
| 1013 |
\prop_gput:Nnn \g__pdfmanagement_documentproperties_prop |
| 1014 |
{ |
| 1015 |
\tl_if_blank:eTF {#1}{top-level/}{#1/} #2 |
| 1016 |
} |
| 1017 |
{ #3} |
| 1018 |
} |
| 1019 |
\cs_new:Npn\GetDocumentProperty #1 |
| 1020 |
{ |
| 1021 |
\prop_item:Nn \g__pdfmanagement_documentproperties_prop {#1} |
| 1022 |
} |
| 1023 |
\cs_new_eq:NN\GetDocumentProperties\GetDocumentProperty |
| 1024 |
\cs_new:Npn\pdfmanagement_get_documentproperty:n #1 |
| 1025 |
{ |
| 1026 |
\prop_item:Nn \g__pdfmanagement_documentproperties_prop {#1} |
| 1027 |
} |
| 1028 |
\cs_new_eq:NN |
| 1029 |
\pdfmanagement_get_documentproperties:n |
| 1030 |
\pdfmanagement_get_documentproperty:n |
| 1031 |
\prg_new_protected_conditional:Npnn |
| 1032 |
\pdfmanagement_get_documentproperty:nN #1#2 { T , F , TF } |
| 1033 |
{ |
| 1034 |
\prop_get:NnNTF \g__pdfmanagement_documentproperties_prop {#1} #2 |
| 1035 |
{ |
| 1036 |
\prg_return_true: |
| 1037 |
} |
| 1038 |
{ |
| 1039 |
\prg_return_false: |
| 1040 |
} |
| 1041 |
} |
| 1042 |
\prg_new_eq_conditional:NNn |
| 1043 |
\pdfmanagement_get_documentproperties:nN |
| 1044 |
\pdfmanagement_get_documentproperty:nN |
| 1045 |
{ T , F , TF } |
| 1046 |
\msg_new:nnn { pdfmanagement } { show-properties } |
| 1047 |
{ |
| 1048 |
The~following~document~properties~have~been~stored: |
| 1049 |
#1 |
| 1050 |
} |
| 1051 |
\NewDocumentCommand\ShowDocumentProperties {} |
| 1052 |
{ |
| 1053 |
\msg_show:nne {pdfmanagement}{show-properties} |
| 1054 |
{ |
| 1055 |
\prop_map_function:NN \g__pdfmanagement_documentproperties_prop \msg_show_item:nn |
| 1056 |
} |
| 1057 |
} |
| 1058 |
\NewDocumentCommand\LogDocumentProperties {} |
| 1059 |
{ |
| 1060 |
\msg_log:nne {pdfmanagement}{show-properties} |
| 1061 |
{ |
| 1062 |
\prop_map_function:NN \g__pdfmanagement_documentproperties_prop \msg_show_item:nn |
| 1063 |
} |
| 1064 |
} |
| 1065 |
} % end of existence test |
| 1066 |
%% File: l3pdfannot.dtx |
| 1067 |
\cs_if_exist:NF \bitset_new:Nn |
| 1068 |
{ \RequirePackage { l3bitset } } |
| 1069 |
\bitset_new:Nn \l_pdfannot_F_bitset |
| 1070 |
{ |
| 1071 |
Invisible = 1, |
| 1072 |
Hidden = 2, |
| 1073 |
Print = 3, |
| 1074 |
NoZoom = 4, |
| 1075 |
NoRotate = 5, |
| 1076 |
NoView = 6, |
| 1077 |
ReadOnly = 7, |
| 1078 |
Locked = 8, |
| 1079 |
ToggleNoView = 9, |
| 1080 |
LockedContents = 10 |
| 1081 |
} |
| 1082 |
\bool_new:N \g__pdfannot_use_lastlink_bool |
| 1083 |
\cs_new_protected:Npn \pdfannot_box:nnnn #1 #2 #3 #4 |
| 1084 |
{ |
| 1085 |
\__pdf_backend_annotation:nnnn {#1}{#2}{#3}{#4} |
| 1086 |
\bool_gset_false:N\g__pdfannot_use_lastlink_bool |
| 1087 |
} |
| 1088 |
\cs_generate_variant:Nn \pdfannot_box:nnnn {nnne,nnnx} |
| 1089 |
\cs_new:Npn \pdfannot_box_ref_last: |
| 1090 |
{ |
| 1091 |
\__pdf_backend_annotation_last: |
| 1092 |
} |
| 1093 |
|
| 1094 |
\pdfdict_new:n { l__pdfannot/widget } |
| 1095 |
\pdfdict_new:n { l__pdfannot/widget/AA } |
| 1096 |
\pdfdict_new:n { l__pdfannot/widget/AP } |
| 1097 |
\pdfdict_new:n { l__pdfannot/widget/MK } |
| 1098 |
\pdfdict_new:n { l__pdfannot/widget/BS } |
| 1099 |
\pdfdict_put:nnn { l__pdfannot/widget }{ Subtype }{ /Widget } |
| 1100 |
\hook_new_pair:nn |
| 1101 |
{pdfannot/widget/before} |
| 1102 |
{pdfannot/widget/after} |
| 1103 |
\cs_new_protected:Npn \pdfannot_widget_box:nnn #1 #2 #3 |
| 1104 |
{ |
| 1105 |
\hook_use:n { pdfannot/widget/before } |
| 1106 |
\group_begin: |
| 1107 |
\pdfmeta_standard_verify:nT |
| 1108 |
{annot_widget_no_AA} |
| 1109 |
{ |
| 1110 |
\pdfdict_if_empty:nF { l__pdfannot/widget/AA } |
| 1111 |
{ |
| 1112 |
\pdf_object_unnamed_write:ne {dict}{\pdfdict_use:n{l__pdfannot/widget/AA}} |
| 1113 |
\pdfdict_put:nne { l__pdfannot/widget } |
| 1114 |
{AA} |
| 1115 |
{\pdf_object_ref_last:} |
| 1116 |
} |
| 1117 |
} |
| 1118 |
\pdfdict_if_empty:nF { l__pdfannot/widget/AP } |
| 1119 |
{ |
| 1120 |
\pdf_object_unnamed_write:ne {dict}{\pdfdict_use:n{l__pdfannot/widget/AP}} |
| 1121 |
\pdfdict_put:nne { l__pdfannot/widget } |
| 1122 |
{AP} |
| 1123 |
{\pdf_object_ref_last:} |
| 1124 |
} |
| 1125 |
\pdfdict_if_empty:nF { l__pdfannot/widget/MK } |
| 1126 |
{ |
| 1127 |
\pdf_object_unnamed_write:ne {dict}{\pdfdict_use:n{l__pdfannot/widget/MK}} |
| 1128 |
\pdfdict_put:nne { l__pdfannot/widget } |
| 1129 |
{MK} |
| 1130 |
{\pdf_object_ref_last:} |
| 1131 |
} |
| 1132 |
\pdfdict_if_empty:nF { l__pdfannot/widget/BS } |
| 1133 |
{ |
| 1134 |
\pdf_object_unnamed_write:ne {dict}{\pdfdict_use:n{l__pdfannot/widget/BS}} |
| 1135 |
\pdfdict_put:nne { l__pdfannot/widget } |
| 1136 |
{BS} |
| 1137 |
{\pdf_object_ref_last:} |
| 1138 |
} |
| 1139 |
\pdfannot_box:nnne {#1}{#2}{#3} |
| 1140 |
{ |
| 1141 |
\pdfdict_use:n { l__pdfannot/widget} |
| 1142 |
} |
| 1143 |
\hook_use:n { pdfannot/widget/end } |
| 1144 |
\group_end: |
| 1145 |
\bool_gset_false:N\g__pdfannot_use_lastlink_bool |
| 1146 |
} |
| 1147 |
\seq_const_from_clist:Nn \c_pdfannot_link_types_seq { URI , GoToR , Launch , GoTo, Named } |
| 1148 |
\seq_map_inline:Nn \c_pdfannot_link_types_seq |
| 1149 |
{ |
| 1150 |
\pdfdict_new:n { l__pdfannot/link/#1 } |
| 1151 |
\pdfdict_put:nnn { l__pdfannot/link/#1 }{ Subtype }{ /Link } |
| 1152 |
\hook_new_pair:nn |
| 1153 |
{pdfannot/link/#1/before} |
| 1154 |
{pdfannot/link/#1/after} |
| 1155 |
\hook_new_pair:nn |
| 1156 |
{pdfannot/link/#1/begin} |
| 1157 |
{pdfannot/link/#1/end} |
| 1158 |
} |
| 1159 |
\cs_if_free:NT \pdfannot_link_off: |
| 1160 |
{ |
| 1161 |
\cs_new_protected:Nn \pdfannot_link_off: { \__pdfannot_backend_link_off: } |
| 1162 |
\cs_new_protected:Nn \pdfannot_link_on: { \__pdfannot_backend_link_on: } |
| 1163 |
} |
| 1164 |
\cs_new_protected:Nn \pdfannot_link:nnn %#1 type (URI, GoTo etc), |
| 1165 |
%#2 action spec, #3 link text |
| 1166 |
{ |
| 1167 |
\hook_use:n { pdfannot/link/#1/before} |
| 1168 |
\mode_leave_vertical: |
| 1169 |
\exp_args:Nee %xetex needs expansion |
| 1170 |
\__pdfannot_backend_link_begin_user:nnw |
| 1171 |
{ |
| 1172 |
\pdfdict_if_exist:nT { l__pdfannot/link/#1 } |
| 1173 |
{ |
| 1174 |
\pdfdict_use:n { l__pdfannot/link/#1} |
| 1175 |
} |
| 1176 |
} |
| 1177 |
{ |
| 1178 |
#2 %exp_not? |
| 1179 |
} |
| 1180 |
\bool_gset_true:N \g__pdfannot_use_lastlink_bool |
| 1181 |
\hook_use:n { pdfannot/link/#1/begin} |
| 1182 |
#3 |
| 1183 |
\hook_use:n { pdfannot/link/#1/end} |
| 1184 |
\__pdfannot_backend_link_end: |
| 1185 |
\bool_gset_true:N \g__pdfannot_use_lastlink_bool |
| 1186 |
\hook_use:n { pdfannot/link/#1/after} |
| 1187 |
} |
| 1188 |
\cs_generate_variant:Nn \pdfannot_link:nnn {nen,nxn} |
| 1189 |
\cs_new_protected:Npn \pdfannot_link_begin:nnw #1 #2 %#1 type, #2 action spec |
| 1190 |
{ |
| 1191 |
\hook_use:n { pdfannot/link/#1/before} |
| 1192 |
\mode_leave_vertical: |
| 1193 |
\exp_args:Nee %xetex needs expansion |
| 1194 |
\__pdfannot_backend_link_begin_user:nnw |
| 1195 |
{ |
| 1196 |
\pdfdict_if_exist:nT { l__pdfannot/link/#1 } |
| 1197 |
{ |
| 1198 |
\pdfdict_use:n { l__pdfannot/link/#1} |
| 1199 |
} |
| 1200 |
} |
| 1201 |
{ #2 } |
| 1202 |
\bool_gset_true:N \g__pdfannot_use_lastlink_bool |
| 1203 |
\hook_use:n { pdfannot/link/#1/begin} |
| 1204 |
} |
| 1205 |
|
| 1206 |
\cs_new_protected:Nn \pdfannot_link_end:n %#1 type, e.g. url |
| 1207 |
{ |
| 1208 |
\hook_use:n { pdfannot/link/#1/end} |
| 1209 |
\__pdfannot_backend_link_end: |
| 1210 |
\bool_gset_true:N \g__pdfannot_use_lastlink_bool |
| 1211 |
\hook_use:n { pdfannot/link/#1/after} |
| 1212 |
} |
| 1213 |
\cs_generate_variant:Nn \pdfannot_link_begin:nnw {new,nxw} |
| 1214 |
\cs_new_protected:Npn \pdfannot_link_goto_begin:nw #1 %#1 destination |
| 1215 |
{ |
| 1216 |
\pdfdict_remove:nn { l__pdfannot/link/GoTo} {Subtype} |
| 1217 |
\hook_use:n { pdfannot/link/GoTo/before} %the backend add it too |
| 1218 |
\mode_leave_vertical: |
| 1219 |
\exp_args:Nee %xetex needs expansion |
| 1220 |
\__pdfannot_backend_link_begin_goto:nnw |
| 1221 |
{ |
| 1222 |
\pdfdict_use:n { l__pdfannot/link/GoTo} |
| 1223 |
} |
| 1224 |
{ #1 } |
| 1225 |
\bool_gset_true:N \g__pdfannot_use_lastlink_bool |
| 1226 |
\pdfdict_put:nnn { l__pdfannot/link/GoTo} {Subtype}{GoTo} |
| 1227 |
\hook_use:n { pdfannot/link/GoTo/begin} |
| 1228 |
} |
| 1229 |
|
| 1230 |
\cs_new_protected:Nn \pdfannot_link_goto_end: |
| 1231 |
{ |
| 1232 |
\hook_use:n { pdfannot/link/GoTo/end} |
| 1233 |
\__pdfannot_backend_link_end: |
| 1234 |
\bool_gset_true:N \g__pdfannot_use_lastlink_bool |
| 1235 |
\hook_use:n { pdfannot/link/GoTo/after} |
| 1236 |
} |
| 1237 |
\cs_new:Nn \pdfannot_link_ref_last: { \__pdfannot_backend_link_last: } |
| 1238 |
\cs_new:Npn \pdfannot_ref_last: |
| 1239 |
{ |
| 1240 |
\bool_if:NTF \g__pdfannot_use_lastlink_bool |
| 1241 |
{ |
| 1242 |
\__pdfannot_backend_link_last: |
| 1243 |
} |
| 1244 |
{ |
| 1245 |
\__pdf_backend_annotation_last: |
| 1246 |
} |
| 1247 |
} |
| 1248 |
\cs_new_protected:Npn \pdfannot_link_margin:n #1 |
| 1249 |
{ |
| 1250 |
\__pdfannot_backend_link_margin:n { #1 } |
| 1251 |
} |
| 1252 |
\cs_new_protected:Npn \pdfannot_dict_put:nnn #1 #2 #3 |
| 1253 |
{ |
| 1254 |
\pdfdict_put:nnn { l__pdfannot/#1 } { #2 }{ #3 } |
| 1255 |
} |
| 1256 |
\cs_generate_variant:Nn \pdfannot_dict_put:nnn {nne,nnx} |
| 1257 |
\cs_new_protected:Npn \pdfannot_dict_remove:nn #1 #2 |
| 1258 |
{ |
| 1259 |
\pdfdict_remove:nn { l__pdfannot/#1 } { #2 } |
| 1260 |
} |
| 1261 |
\cs_new_protected:Npn \pdfannot_dict_show:n #1 |
| 1262 |
{ |
| 1263 |
\pdfdict_show:n { l__pdfannot/#1 } |
| 1264 |
} |
| 1265 |
|
| 1266 |
\cs_new:Npn \pdfannot_dict_use:n #1 |
| 1267 |
{ |
| 1268 |
\pdfdict_use:n { l__pdfannot/#1 } |
| 1269 |
} |
| 1270 |
%% File: l3pdfxform.dtx |
| 1271 |
\cs_new_protected:Npn \pdfxform_new:nnn #1 #2 #3 |
| 1272 |
{ |
| 1273 |
\__pdf_backend_xform_new:nnnn { #1 } { #2 } { } { #3 } |
| 1274 |
} |
| 1275 |
\cs_new_protected:Npn \pdfxform_use:n #1 |
| 1276 |
{ |
| 1277 |
\__pdf_backend_xform_use:n { #1 } |
| 1278 |
} |
| 1279 |
\cs_new:Npn \pdfxform_ref:n #1 |
| 1280 |
{ |
| 1281 |
\__pdf_backend_xform_ref:n { #1 } |
| 1282 |
} |
| 1283 |
|
| 1284 |
\cs_generate_variant:Nn \pdfxform_ref:n {o} |
| 1285 |
\cs_new:Npn \pdfxform_wd:n #1 |
| 1286 |
{ |
| 1287 |
\tl_use:c { c__pdf_backend_xform_wd_ \tl_to_str:n { #1 } _tl } |
| 1288 |
} |
| 1289 |
|
| 1290 |
\cs_new:Npn \pdfxform_ht:n #1 |
| 1291 |
{ |
| 1292 |
\tl_use:c { c__pdf_backend_xform_ht_ \tl_to_str:n { #1 } _tl } |
| 1293 |
} |
| 1294 |
|
| 1295 |
\cs_new:Npn \pdfxform_dp:n #1 |
| 1296 |
{ |
| 1297 |
\tl_use:c { c__pdf_backend_xform_dp_ \tl_to_str:n { #1 } _tl } |
| 1298 |
} |
| 1299 |
%% File: l3pdfmeta.dtx |
| 1300 |
|
| 1301 |
|
| 1302 |
|
| 1303 |
\msg_new:nnn {pdf }{unknown-standard}{The~standard~'#1'~is~unknown~and~has~been~ignored} |
| 1304 |
\msg_new:nnn {pdf }{unknown-standard-family}{The~standard~family~'#1'~is~unknown} |
| 1305 |
\msg_new:nnn {pdf }{wrong-pdfversion} |
| 1306 |
{PDF~version~#1~is~too~#2~for~standard~'#3'.\\ |
| 1307 |
Check~if~there~are~conflicting~PDF~standard\\ |
| 1308 |
and~PDF~version~settings!} |
| 1309 |
\msg_new:nnn {pdf }{validation-failure} |
| 1310 |
{ |
| 1311 |
PDF~standard~validation~failure.\\ |
| 1312 |
#1 |
| 1313 |
} |
| 1314 |
\tl_new:N \l__pdfmeta_tmpa_tl |
| 1315 |
\tl_new:N \l__pdfmeta_tmpb_tl |
| 1316 |
\str_new:N \l__pdfmeta_tmpa_str |
| 1317 |
\str_new:N \g__pdfmeta_tmpa_str |
| 1318 |
\seq_new:N \l__pdfmeta_tmpa_seq |
| 1319 |
\seq_new:N \l__pdfmeta_tmpb_seq |
| 1320 |
\prop_new:N \g__pdfmeta_standard_prop |
| 1321 |
\prop_new:N \g__pdfmeta_standard_A_prop |
| 1322 |
\prop_new:N \g__pdfmeta_standard_UA_prop |
| 1323 |
\prop_new:N \g__pdfmeta_standard_X_prop |
| 1324 |
\cs_new_protected:Npn \pdfmeta_standard_family:nn #1 #2 |
| 1325 |
{ |
| 1326 |
\prop_if_exist:cTF { g__pdfmeta_standard_#1_prop } |
| 1327 |
{ |
| 1328 |
\prop_gset_eq:NN \g__pdfmeta_standard_A_prop \g__pdfmeta_standard_prop |
| 1329 |
\prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_#1_prop } |
| 1330 |
#2 |
| 1331 |
\prop_gset_eq:NN \g__pdfmeta_standard_prop \g__pdfmeta_standard_A_prop |
| 1332 |
} |
| 1333 |
{ |
| 1334 |
\msg_warning:nnn {pdf} {unknown-standard-family}{#1} |
| 1335 |
} |
| 1336 |
} |
| 1337 |
\cs_new:Npn \pdfmeta_standard_item:n #1 |
| 1338 |
{ |
| 1339 |
\prop_item:Nn \g__pdfmeta_standard_prop {#1} |
| 1340 |
} |
| 1341 |
\cs_new_protected:Npn \pdfmeta_standard_get:nN #1 #2 |
| 1342 |
{ |
| 1343 |
\prop_get:NnN \g__pdfmeta_standard_prop {#1} #2 |
| 1344 |
} |
| 1345 |
\prg_new_conditional:Npnn \pdfmeta_standard_verify:n #1 {T,F,TF} |
| 1346 |
{ |
| 1347 |
\prop_if_in:NnTF \g__pdfmeta_standard_prop {#1} |
| 1348 |
{ |
| 1349 |
\prg_return_false: |
| 1350 |
} |
| 1351 |
{ |
| 1352 |
\prg_return_true: |
| 1353 |
} |
| 1354 |
} |
| 1355 |
\prg_new_protected_conditional:Npnn \pdfmeta_standard_verify:nn #1 #2 {T,F,TF} |
| 1356 |
{ |
| 1357 |
\prop_if_in:NnTF \g__pdfmeta_standard_prop {#1} |
| 1358 |
{ |
| 1359 |
\cs_if_exist:cTF {__pdfmeta_standard_verify_handler_#1:nn} |
| 1360 |
{ |
| 1361 |
\exp_args:Nnne |
| 1362 |
\use:c |
| 1363 |
{__pdfmeta_standard_verify_handler_#1:nn} |
| 1364 |
{ #2 } |
| 1365 |
{ \prop_item:Nn \g__pdfmeta_standard_prop {#1} } |
| 1366 |
} |
| 1367 |
{ |
| 1368 |
\prg_return_false: |
| 1369 |
} |
| 1370 |
} |
| 1371 |
{ |
| 1372 |
\prg_return_true: |
| 1373 |
} |
| 1374 |
} |
| 1375 |
\cs_new_protected:Npn \__pdfmeta_standard_verify_handler_min_pdf_version:nn #1 #2 |
| 1376 |
{ |
| 1377 |
\pdf_version_compare:NnTF < |
| 1378 |
{ #2 } |
| 1379 |
{\prg_return_false:} |
| 1380 |
{\prg_return_true:} |
| 1381 |
} |
| 1382 |
\cs_new_protected:Npn \__pdfmeta_standard_verify_handler_max_pdf_version:nn #1 #2 |
| 1383 |
{ |
| 1384 |
\pdf_version_compare:NnTF > |
| 1385 |
{ #2 } |
| 1386 |
{\prg_return_false:} |
| 1387 |
{\prg_return_true:} |
| 1388 |
} |
| 1389 |
|
| 1390 |
\cs_new_protected:Npn \__pdfmeta_standard_verify_handler_named_actions:nn #1 #2 |
| 1391 |
{ |
| 1392 |
\tl_if_in:nnTF { #2 }{ #1 } |
| 1393 |
{\prg_return_true:} |
| 1394 |
{\prg_return_false:} |
| 1395 |
} |
| 1396 |
\cs_new_protected:Npn \__pdfmeta_standard_verify_handler_annot_action_A:nn #1 #2 |
| 1397 |
{ |
| 1398 |
\tl_if_in:nnTF { #2 }{ #1 } |
| 1399 |
{\prg_return_true:} |
| 1400 |
{\prg_return_false:} |
| 1401 |
} |
| 1402 |
\cs_new_protected:Npn \__pdfmeta_standard_verify_handler_outputintent_subtype:nn #1 #2 |
| 1403 |
{ |
| 1404 |
\tl_if_eq:nnTF { #2 }{ #1 } |
| 1405 |
{\prg_return_true:} |
| 1406 |
{\prg_return_false:} |
| 1407 |
} |
| 1408 |
\cs_new_protected:Npn \__pdfmeta_verify_pdfa_annot_flags: |
| 1409 |
{ |
| 1410 |
\bitset_set_true:Nn \l_pdfannot_F_bitset {Print} |
| 1411 |
\bitset_set_false:Nn \l_pdfannot_F_bitset {Hidden} |
| 1412 |
\bitset_set_false:Nn \l_pdfannot_F_bitset {Invisible} |
| 1413 |
\bitset_set_false:Nn \l_pdfannot_F_bitset {NoView} |
| 1414 |
\pdfannot_dict_put:nnn {link/URI}{F}{ \bitset_to_arabic:N \l_pdfannot_F_bitset } |
| 1415 |
\pdfannot_dict_put:nnn {link/GoTo}{F}{ \bitset_to_arabic:N \l_pdfannot_F_bitset } |
| 1416 |
\pdfannot_dict_put:nnn {link/GoToR}{F}{ \bitset_to_arabic:N \l_pdfannot_F_bitset } |
| 1417 |
\pdfannot_dict_put:nnn {link/Launch}{F}{ \bitset_to_arabic:N \l_pdfannot_F_bitset } |
| 1418 |
\pdfannot_dict_put:nnn {link/Named}{F}{ \bitset_to_arabic:N \l_pdfannot_F_bitset } |
| 1419 |
} |
| 1420 |
\hook_gput_code:nnn {begindocument} {pdf} |
| 1421 |
{ |
| 1422 |
\pdfmeta_standard_verify:nF { annot_flags } |
| 1423 |
{ \__pdfmeta_verify_pdfa_annot_flags: } |
| 1424 |
\pdfmeta_standard_verify:nF { Trailer_no_Info } |
| 1425 |
{ \__pdf_backend_omit_info:n {1} } |
| 1426 |
\pdfmeta_standard_verify:nF { no_CharSet } |
| 1427 |
{ \__pdf_backend_omit_charset:n {1} } |
| 1428 |
\pdfmeta_standard_verify:nF { omit_CID } |
| 1429 |
{ \__pdf_backend_omit_cidset:n {1} } |
| 1430 |
\__pdfmeta_check_standard_pdfversion: |
| 1431 |
} |
| 1432 |
\prop_new:c { g__pdfmeta_standard_pdf/A-1B_prop } |
| 1433 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/A-1B_prop } |
| 1434 |
{ |
| 1435 |
,name = pdf/A-1B |
| 1436 |
,type = A |
| 1437 |
,level = 1 |
| 1438 |
,conformance = B |
| 1439 |
,year = 2005 |
| 1440 |
,min_pdf_version = 1.4 %minimum |
| 1441 |
,max_pdf_version = 1.4 %maximum |
| 1442 |
,no_encryption = |
| 1443 |
,no_external_content = % no F, FFilter, or FDecodeParms in stream dicts |
| 1444 |
,no_embed_content = % no EF key in filespec, no /Type/EmbeddedFiles |
| 1445 |
,max_string_size = 65535 |
| 1446 |
,max_array_size = 8191 |
| 1447 |
,max_dict_size = 4095 |
| 1448 |
,max_obj_num = 8388607 |
| 1449 |
,max_nest_qQ = 28 |
| 1450 |
,named_actions = {NextPage, PrevPage, FirstPage, LastPage} |
| 1451 |
,annot_flags = |
| 1452 |
%booleans. Only the existence of the key matter. |
| 1453 |
%If the entry is added it means a requirements is there |
| 1454 |
%(in most cases "don't use ...") |
| 1455 |
% |
| 1456 |
%=============== |
| 1457 |
% Rule 6.1.13-1 CosDocument, isOptionalContentPresent == false |
| 1458 |
,Catalog_no_OCProperties = |
| 1459 |
% Rule 6.9-4 The AS key shall not appear in any optional content configuration dictionary. |
| 1460 |
% actually only starting with A-2 but doesn't harm here either |
| 1461 |
,Catalog_OCProperties_no_AS= |
| 1462 |
%=============== |
| 1463 |
% Rule 6.6.1-1: PDAction, S == "GoTo" || S == "GoToR" || S == "Thread" |
| 1464 |
% || S == "URI" || S == "Named" || S == "SubmitForm" |
| 1465 |
% means: no /S/Launch, /S/Sound, /S/Movie, /S/ResetForm, /S/ImportData, |
| 1466 |
% /S/JavaScript, /S/Hide |
| 1467 |
,annot_action_A = {GoTo,GoToR,Thread,URI,Named,SubmitForm} |
| 1468 |
%=============== |
| 1469 |
% Rule 6.6.2-1: PDAnnot, Subtype != "Widget" || AA_size == 0 |
| 1470 |
% means: no AA dictionary |
| 1471 |
,annot_widget_no_AA = |
| 1472 |
%=============== |
| 1473 |
% Rule 6.9-2: PDAnnot, Subtype != "Widget" || (A_size == 0 && AA_size == 0) |
| 1474 |
% (looks like a tightening of the previous rule) |
| 1475 |
,annot_widget_no_A_AA = |
| 1476 |
%=============== |
| 1477 |
% Rule 6.9-1 PDAcroForm, NeedAppearances == null || NeedAppearances == false |
| 1478 |
,form_no_NeedAppearances = |
| 1479 |
%=============== |
| 1480 |
%Rule 6.9-3 PDFormField, AA_size == 0 |
| 1481 |
,form_no_AA = |
| 1482 |
%=============== |
| 1483 |
% to be continued https://docs.verapdf.org/validation/pdfa-part1/ |
| 1484 |
% - Outputintent/colorprofiles requirements |
| 1485 |
% an outputintent should be loaded and is unique. |
| 1486 |
,outputintent_A = {GTS_PDFA1} |
| 1487 |
% - no Alternates key in image dictionaries |
| 1488 |
% - no OPI, Ref, Subtype2 with PS key in xobjects |
| 1489 |
% - Interpolate = false in images |
| 1490 |
% - no TR, TR2 in ExtGstate |
| 1491 |
} |
| 1492 |
|
| 1493 |
\prop_new:c { g__pdfmeta_standard_pdf/A-2B_prop } |
| 1494 |
\prop_gset_eq:cc |
| 1495 |
{ g__pdfmeta_standard_pdf/A-2B_prop } |
| 1496 |
{ g__pdfmeta_standard_pdf/A-1B_prop } |
| 1497 |
\prop_gput:cnn |
| 1498 |
{ g__pdfmeta_standard_pdf/A-2B_prop }{name}{pdf/A-2B} |
| 1499 |
\prop_gput:cnn |
| 1500 |
{ g__pdfmeta_standard_pdf/A-2B_prop }{year}{2011} |
| 1501 |
\prop_gput:cnn |
| 1502 |
{ g__pdfmeta_standard_pdf/A-2B_prop }{level}{2} |
| 1503 |
\prop_gremove:cn |
| 1504 |
{ g__pdfmeta_standard_pdf/A-2B_prop } |
| 1505 |
{ no_embed_content } |
| 1506 |
\prop_gput:cnn |
| 1507 |
{ g__pdfmeta_standard_pdf/A-2B_prop } |
| 1508 |
{ only_pdfa_embed_content } |
| 1509 |
{} |
| 1510 |
\prop_gput:cnn |
| 1511 |
{ g__pdfmeta_standard_pdf/A-2B_prop }{max_pdf_version}{1.7} |
| 1512 |
\prop_gput:cnn |
| 1513 |
{ g__pdfmeta_standard_pdf/A-2B_prop }{omit_CID}{} |
| 1514 |
\prop_gremove:cn |
| 1515 |
{ g__pdfmeta_standard_pdf/A-2B_prop } |
| 1516 |
{ Catalog_no_OCProperties } |
| 1517 |
|
| 1518 |
%A-2u ============== |
| 1519 |
\prop_new:c { g__pdfmeta_standard_pdf/A-2U_prop } |
| 1520 |
\prop_gset_eq:cc |
| 1521 |
{ g__pdfmeta_standard_pdf/A-2U_prop } |
| 1522 |
{ g__pdfmeta_standard_pdf/A-2B_prop } |
| 1523 |
\prop_gput:cnn |
| 1524 |
{ g__pdfmeta_standard_pdf/A-2U_prop }{name}{pdf/A-2U} |
| 1525 |
\prop_gput:cnn |
| 1526 |
{ g__pdfmeta_standard_pdf/A-2U_prop }{conformance}{U} |
| 1527 |
\prop_gput:cnn |
| 1528 |
{ g__pdfmeta_standard_pdf/A-2U_prop }{unicode}{} |
| 1529 |
|
| 1530 |
\prop_new:c { g__pdfmeta_standard_pdf/A-2A_prop } |
| 1531 |
\prop_gset_eq:cc |
| 1532 |
{ g__pdfmeta_standard_pdf/A-2A_prop } |
| 1533 |
{ g__pdfmeta_standard_pdf/A-2B_prop } |
| 1534 |
\prop_gput:cnn |
| 1535 |
{ g__pdfmeta_standard_pdf/A-2A_prop }{name}{pdf/A-2A} |
| 1536 |
\prop_gput:cnn |
| 1537 |
{ g__pdfmeta_standard_pdf/A-2A_prop }{conformance}{A} |
| 1538 |
\prop_gput:cnn |
| 1539 |
{ g__pdfmeta_standard_pdf/A-2A_prop }{tagged}{} |
| 1540 |
|
| 1541 |
\prop_new:c { g__pdfmeta_standard_pdf/A-3B_prop } |
| 1542 |
\prop_gset_eq:cc |
| 1543 |
{ g__pdfmeta_standard_pdf/A-3B_prop } |
| 1544 |
{ g__pdfmeta_standard_pdf/A-2B_prop } |
| 1545 |
\prop_gput:cnn |
| 1546 |
{ g__pdfmeta_standard_pdf/A-3B_prop }{name}{pdf/A-3B} |
| 1547 |
\prop_gput:cnn |
| 1548 |
{ g__pdfmeta_standard_pdf/A-3B_prop }{year}{2012} |
| 1549 |
\prop_gput:cnn |
| 1550 |
{ g__pdfmeta_standard_pdf/A-3B_prop }{level}{3} |
| 1551 |
\prop_gremove:cn |
| 1552 |
{ g__pdfmeta_standard_pdf/A-3B_prop } |
| 1553 |
{ only_pdfa_embed_content } |
| 1554 |
\prop_new:c { g__pdfmeta_standard_pdf/A-3U_prop } |
| 1555 |
\prop_gset_eq:cc |
| 1556 |
{ g__pdfmeta_standard_pdf/A-3U_prop } |
| 1557 |
{ g__pdfmeta_standard_pdf/A-3B_prop } |
| 1558 |
\prop_gput:cnn |
| 1559 |
{ g__pdfmeta_standard_pdf/A-3U_prop }{name}{pdf/A-3U} |
| 1560 |
\prop_gput:cnn |
| 1561 |
{ g__pdfmeta_standard_pdf/A-3U_prop }{conformance}{U} |
| 1562 |
\prop_gput:cnn |
| 1563 |
{ g__pdfmeta_standard_pdf/A-3U_prop }{unicode}{} |
| 1564 |
|
| 1565 |
\prop_new:c { g__pdfmeta_standard_pdf/A-3A_prop } |
| 1566 |
\prop_gset_eq:cc |
| 1567 |
{ g__pdfmeta_standard_pdf/A-3A_prop } |
| 1568 |
{ g__pdfmeta_standard_pdf/A-3B_prop } |
| 1569 |
\prop_gput:cnn |
| 1570 |
{ g__pdfmeta_standard_pdf/A-3A_prop }{name}{pdf/A-3A} |
| 1571 |
\prop_gput:cnn |
| 1572 |
{ g__pdfmeta_standard_pdf/A-3A_prop }{conformance}{A} |
| 1573 |
\prop_gput:cnn |
| 1574 |
{ g__pdfmeta_standard_pdf/A-3A_prop }{tagged}{} |
| 1575 |
|
| 1576 |
\prop_new:c { g__pdfmeta_standard_pdf/A-4_prop } |
| 1577 |
\prop_gset_eq:cc |
| 1578 |
{ g__pdfmeta_standard_pdf/A-4_prop } |
| 1579 |
{ g__pdfmeta_standard_pdf/A-3U_prop } |
| 1580 |
\prop_gput:cnn |
| 1581 |
{ g__pdfmeta_standard_pdf/A-4_prop }{name}{pdf/A-4} |
| 1582 |
\prop_gput:cnn |
| 1583 |
{ g__pdfmeta_standard_pdf/A-4_prop }{level}{4} |
| 1584 |
\prop_gput:cnn |
| 1585 |
{ g__pdfmeta_standard_pdf/A-4_prop }{min_pdf_version}{2.0} |
| 1586 |
\prop_gput:cnn |
| 1587 |
{ g__pdfmeta_standard_pdf/A-4_prop }{year}{2020} |
| 1588 |
\prop_gput:cnn |
| 1589 |
{ g__pdfmeta_standard_pdf/A-4_prop }{no_CharSet}{} |
| 1590 |
\prop_gput:cnn |
| 1591 |
{ g__pdfmeta_standard_pdf/A-4_prop }{Trailer_no_Info}{} |
| 1592 |
\prop_gput:cnn |
| 1593 |
{ g__pdfmeta_standard_pdf/A-4_prop }{only_pdfa_embed_content}{} |
| 1594 |
\prop_gremove:cn |
| 1595 |
{ g__pdfmeta_standard_pdf/A-4_prop }{conformance} |
| 1596 |
\prop_gremove:cn |
| 1597 |
{ g__pdfmeta_standard_pdf/A-4_prop }{max_pdf_version} |
| 1598 |
\prop_gremove:cn |
| 1599 |
{ g__pdfmeta_standard_pdf/A-4_prop }{Catalog_OCProperties_no_AS} |
| 1600 |
\prop_new:c { g__pdfmeta_standard_pdf/A-4F_prop } |
| 1601 |
\prop_gset_eq:cc |
| 1602 |
{ g__pdfmeta_standard_pdf/A-4F_prop } |
| 1603 |
{ g__pdfmeta_standard_pdf/A-4_prop } |
| 1604 |
\prop_gput:cnn |
| 1605 |
{ g__pdfmeta_standard_pdf/A-4F_prop }{conformance}{F} |
| 1606 |
\prop_gput:cnn |
| 1607 |
{ g__pdfmeta_standard_pdf/A-4F_prop }{Catalog_EmbeddedFiles}{} |
| 1608 |
\prop_gremove:cn |
| 1609 |
{ g__pdfmeta_standard_pdf/A-4F_prop }{only_pdfa_embed_content} |
| 1610 |
\prop_new:c { g__pdfmeta_standard_pdf/A-4E_prop } |
| 1611 |
\prop_gset_eq:cc |
| 1612 |
{ g__pdfmeta_standard_pdf/A-4E_prop } |
| 1613 |
{ g__pdfmeta_standard_pdf/A-4_prop } |
| 1614 |
\prop_gput:cnn |
| 1615 |
{ g__pdfmeta_standard_pdf/A-4E_prop }{conformance}{E} |
| 1616 |
\prop_new:c { g__pdfmeta_standard_pdf/UA-1_prop} |
| 1617 |
\prop_new:c { g__pdfmeta_standard_pdf/UA-2_prop} |
| 1618 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/UA-1_prop } |
| 1619 |
{ |
| 1620 |
,name = pdf/UA-1 |
| 1621 |
,level = 1 |
| 1622 |
,year = 2014 |
| 1623 |
,min_pdf_version = 1.4 %minimum |
| 1624 |
,max_pdf_version = 1.7 %maximum |
| 1625 |
,tagged = |
| 1626 |
,link_Contents = |
| 1627 |
} |
| 1628 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/UA-2_prop } |
| 1629 |
{ |
| 1630 |
,name = pdf/UA-2 |
| 1631 |
,level = 2 |
| 1632 |
,year = 2024 |
| 1633 |
,min_pdf_version = 2.0 %minimum |
| 1634 |
,tagged = |
| 1635 |
} |
| 1636 |
\prop_new:c { g__pdfmeta_standard_pdf/X-4_prop} |
| 1637 |
\prop_new:c { g__pdfmeta_standard_pdf/X-4P_prop} |
| 1638 |
\prop_new:c { g__pdfmeta_standard_pdf/X-5G_prop} |
| 1639 |
\prop_new:c { g__pdfmeta_standard_pdf/X-5N_prop} |
| 1640 |
\prop_new:c { g__pdfmeta_standard_pdf/X-5PG_prop} |
| 1641 |
\prop_new:c { g__pdfmeta_standard_pdf/X-6_prop} |
| 1642 |
\prop_new:c { g__pdfmeta_standard_pdf/X-6N_prop} |
| 1643 |
\prop_new:c { g__pdfmeta_standard_pdf/X-6P_prop} |
| 1644 |
|
| 1645 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/X-4_prop } |
| 1646 |
{ |
| 1647 |
,name = PDF/X-4 |
| 1648 |
} |
| 1649 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/X-4P_prop } |
| 1650 |
{ |
| 1651 |
,name = PDF/X-4p |
| 1652 |
} |
| 1653 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/X-5G_prop } |
| 1654 |
{ |
| 1655 |
,name = PDF/X-5g |
| 1656 |
} |
| 1657 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/X-5N_prop } |
| 1658 |
{ |
| 1659 |
,name = PDF/X-5n |
| 1660 |
} |
| 1661 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/X-5PG_prop } |
| 1662 |
{ |
| 1663 |
,name = PDF/X-5pg |
| 1664 |
} |
| 1665 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/X-6_prop } |
| 1666 |
{ |
| 1667 |
,name = PDF/X-6 |
| 1668 |
} |
| 1669 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/X-6N_prop } |
| 1670 |
{ |
| 1671 |
,name = PDF/X-6n |
| 1672 |
} |
| 1673 |
\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/X-6P_prop } |
| 1674 |
{ |
| 1675 |
,name = PDF/X-6p |
| 1676 |
} |
| 1677 |
\AddToHook{begindocument/end} |
| 1678 |
{ |
| 1679 |
\pdfmeta_standard_verify:nF{Catalog_EmbeddedFiles} |
| 1680 |
{ |
| 1681 |
\tl_gput_right:Nn\g__kernel_pdfmanagement_end_run_code_tl |
| 1682 |
{ |
| 1683 |
\pdfdict_if_empty:nT { g__pdf_Core/Catalog/Names/EmbeddedFiles } |
| 1684 |
{ |
| 1685 |
\group_begin: |
| 1686 |
\pdfdict_put:nne {l_pdffile/Filespec} {Desc}{(note~about~PDF/A-4F)} |
| 1687 |
\pdfdict_put:nnn { l_pdffile/Filespec }{AFRelationship} { /Unspecified } |
| 1688 |
\pdffile_embed_stream:nnN |
| 1689 |
{The~document~was~declared~to~be~of~type~PDF/A-4f~but~hasn't~any~attachments.~ |
| 1690 |
LaTeX~therefore~added~this~dummy~file.} |
| 1691 |
{pdf-A4f.txt} |
| 1692 |
\l__pdfmeta_tmpa_tl |
| 1693 |
\exp_args:Nne \__pdf_backend_Names_gpush:nn{EmbeddedFiles}{(pdf-A4f)~\l__pdfmeta_tmpa_tl} |
| 1694 |
\group_end: |
| 1695 |
} |
| 1696 |
} |
| 1697 |
} |
| 1698 |
} |
| 1699 |
\AddToHook{enddocument/end} |
| 1700 |
{ |
| 1701 |
\pdfmeta_standard_verify:nF{no_embed_content} |
| 1702 |
{ |
| 1703 |
\bool_lazy_or:nnT |
| 1704 |
{ ! \int_if_zero_p:n { \g_pdffile_embed_pdfa_int } } |
| 1705 |
{ ! \int_if_zero_p:n { \g_pdffile_embed_nonpdfa_int } } |
| 1706 |
{ |
| 1707 |
\prop_get:NnNT\g__pdfmeta_standard_prop { name }\l__pdfmeta_tmpa_tl |
| 1708 |
{ |
| 1709 |
\msg_warning:nne { pdf } { validation-failure } |
| 1710 |
{ |
| 1711 |
Embedded~files~detected.\iow_newline: |
| 1712 |
This~is~not~allowed~in~standard~\l__pdfmeta_tmpa_tl |
| 1713 |
} |
| 1714 |
} |
| 1715 |
} |
| 1716 |
} |
| 1717 |
\pdfmeta_standard_verify:nF {only_pdfa_embed_content} |
| 1718 |
{ |
| 1719 |
\int_if_zero:nF { \g_pdffile_embed_nonpdfa_int } |
| 1720 |
{ |
| 1721 |
\prop_get:NnNT\g__pdfmeta_standard_prop { name }\l__pdfmeta_tmpa_tl |
| 1722 |
{ |
| 1723 |
\str_if_eq:VnTF {\l__pdfmeta_tmpa_tl} { pdf/A-4 } |
| 1724 |
{ |
| 1725 |
\msg_note:nne { pdf } { validation-failure } |
| 1726 |
{ |
| 1727 |
Embedded~non-PDF~files~detected.\iow_newline: |
| 1728 |
Check~if~the~standard~must~be~changed~to~PDF/A-4F |
| 1729 |
} |
| 1730 |
} |
| 1731 |
{ |
| 1732 |
\msg_warning:nne { pdf } { validation-failure } |
| 1733 |
{ |
| 1734 |
Embedded~non-PDF~files~detected.\iow_newline: |
| 1735 |
This~is~not~allowed~in~standard~\l__pdfmeta_tmpa_tl |
| 1736 |
} |
| 1737 |
} |
| 1738 |
} |
| 1739 |
} |
| 1740 |
} |
| 1741 |
} |
| 1742 |
\prop_new:N \g__pdfmeta_outputintents_prop |
| 1743 |
\keys_define:nn { document / metadata } |
| 1744 |
{ |
| 1745 |
colorprofiles .code:n = |
| 1746 |
{ |
| 1747 |
\keys_set:nn { document / metadata / colorprofiles }{#1} |
| 1748 |
} |
| 1749 |
} |
| 1750 |
\keys_define:nn { document / metadata / colorprofiles } |
| 1751 |
{ |
| 1752 |
,A .code:n = |
| 1753 |
{ |
| 1754 |
\tl_if_blank:nF {#1} |
| 1755 |
{ |
| 1756 |
\prop_gput:Nnn \g__pdfmeta_outputintents_prop |
| 1757 |
{ GTS_PDFA1 } {#1} |
| 1758 |
} |
| 1759 |
} |
| 1760 |
,a .code:n = |
| 1761 |
{ |
| 1762 |
\tl_if_blank:nF {#1} |
| 1763 |
{ |
| 1764 |
\prop_gput:Nnn \g__pdfmeta_outputintents_prop |
| 1765 |
{ GTS_PDFA1 } {#1} |
| 1766 |
} |
| 1767 |
} |
| 1768 |
,X .code:n = |
| 1769 |
{ |
| 1770 |
\tl_if_blank:nF {#1} |
| 1771 |
{ |
| 1772 |
\prop_gput:Nnn \g__pdfmeta_outputintents_prop |
| 1773 |
{ GTS_PDFX } {#1} |
| 1774 |
} |
| 1775 |
} |
| 1776 |
,x .code:n = |
| 1777 |
{ |
| 1778 |
\tl_if_blank:nF {#1} |
| 1779 |
{ |
| 1780 |
\prop_gput:Nnn \g__pdfmeta_outputintents_prop |
| 1781 |
{ GTS_PDFX } {#1} |
| 1782 |
} |
| 1783 |
} |
| 1784 |
,unknown .code:n = |
| 1785 |
{ |
| 1786 |
\tl_if_blank:nF {#1} |
| 1787 |
{ |
| 1788 |
\exp_args:NNo |
| 1789 |
\prop_gput:Nnn \g__pdfmeta_outputintents_prop |
| 1790 |
{ \l_keys_key_str } {#1} |
| 1791 |
} |
| 1792 |
} |
| 1793 |
} |
| 1794 |
\pdfdict_new:n {l_pdfmeta/outputintent} |
| 1795 |
\pdfdict_put:nnn {l_pdfmeta/outputintent} |
| 1796 |
{Type}{/OutputIntent} |
| 1797 |
\prop_const_from_keyval:cn { c__pdfmeta_colorprofile_sRGB.icc} |
| 1798 |
{ |
| 1799 |
,OutputConditionIdentifier=IEC~sRGB |
| 1800 |
,Info=IEC~61966-2.1~Default~RGB~colour~space~-~sRGB |
| 1801 |
,RegistryName=http://www.iec.ch |
| 1802 |
,N = 3 |
| 1803 |
} |
| 1804 |
\prop_const_from_keyval:cn { c__pdfmeta_colorprofile_FOGRA39L_coated.icc} |
| 1805 |
{ |
| 1806 |
,OutputConditionIdentifier=FOGRA39L~Coated |
| 1807 |
,Info={Offset~printing,~according~to~ISO~12647-2:2004/Amd~1,~OFCOM,~ % |
| 1808 |
paper~type~1~or~2~=~coated~art,~115~g/m2,~tone~value~increase~ |
| 1809 |
curves~A~(CMY)~and~B~(K)} |
| 1810 |
,RegistryName=http://www.fogra.org |
| 1811 |
,N = 4 |
| 1812 |
} |
| 1813 |
\cs_new_protected:Npn \__pdfmeta_embed_colorprofile:n #1%#1 file name |
| 1814 |
{ |
| 1815 |
\pdf_object_if_exist:nF { __color_icc_ #1 } |
| 1816 |
{ |
| 1817 |
\pdf_object_new:n { __color_icc_ #1 } |
| 1818 |
\pdf_object_write:nne { __color_icc_ #1 } { fstream } |
| 1819 |
{ |
| 1820 |
{/N\c_space_tl |
| 1821 |
\prop_item:cn{c__pdfmeta_colorprofile_#1}{N} |
| 1822 |
} |
| 1823 |
{#1} |
| 1824 |
} |
| 1825 |
} |
| 1826 |
} |
| 1827 |
|
| 1828 |
\cs_new_protected:Npn \__pdfmeta_write_outputintent:nn #1 #2 %#1 file name, #2 subtype |
| 1829 |
{ |
| 1830 |
\group_begin: |
| 1831 |
\pdfdict_put:nne {l_pdfmeta/outputintent}{S}{/\str_convert_pdfname:n{#2}} |
| 1832 |
\pdfdict_put:nne {l_pdfmeta/outputintent} |
| 1833 |
{DestOutputProfile} |
| 1834 |
{\pdf_object_ref:n{ __color_icc_ #1 }} |
| 1835 |
\clist_map_inline:nn { OutputConditionIdentifier, Info, RegistryName } |
| 1836 |
{ |
| 1837 |
\prop_get:cnNT |
| 1838 |
{ c__pdfmeta_colorprofile_#1} |
| 1839 |
{ ##1 } |
| 1840 |
\l__pdfmeta_tmpa_tl |
| 1841 |
{ |
| 1842 |
\pdf_string_from_unicode:nVN {utf8/string}\l__pdfmeta_tmpa_tl\l__pdfmeta_tmpa_str |
| 1843 |
\pdfdict_put:nne |
| 1844 |
{l_pdfmeta/outputintent}{##1}{\l__pdfmeta_tmpa_str} |
| 1845 |
} |
| 1846 |
} |
| 1847 |
\pdf_object_unnamed_write:ne {dict}{\pdfdict_use:n {l_pdfmeta/outputintent} } |
| 1848 |
\pdfmanagement_add:nne {Catalog}{OutputIntents}{\pdf_object_ref_last:} |
| 1849 |
\group_end: |
| 1850 |
} |
| 1851 |
|
| 1852 |
\AddToHook{begindocument/end} |
| 1853 |
{ |
| 1854 |
\pdfmeta_standard_verify:nTF {outputintent_A} |
| 1855 |
{ |
| 1856 |
\prop_map_inline:Nn \g__pdfmeta_outputintents_prop |
| 1857 |
{ |
| 1858 |
\prop_if_exist:cTF {c__pdfmeta_colorprofile_#2} |
| 1859 |
{ |
| 1860 |
\__pdfmeta_embed_colorprofile:n |
| 1861 |
{#2} |
| 1862 |
\__pdfmeta_write_outputintent:nn |
| 1863 |
{#2} |
| 1864 |
{#1} |
| 1865 |
} |
| 1866 |
{ |
| 1867 |
\msg_warning:nnn{pdfmeta}{colorprofile-undefined}{#2} |
| 1868 |
} |
| 1869 |
} |
| 1870 |
} |
| 1871 |
{ |
| 1872 |
\exp_args:NNe |
| 1873 |
\prop_if_in:NnF |
| 1874 |
\g__pdfmeta_outputintents_prop |
| 1875 |
{ \pdfmeta_standard_item:n { outputintent_A } } |
| 1876 |
{ |
| 1877 |
\exp_args:NNe |
| 1878 |
\prop_gput:Nnn |
| 1879 |
\g__pdfmeta_outputintents_prop |
| 1880 |
{ \pdfmeta_standard_item:n { outputintent_A } } |
| 1881 |
{ sRGB.icc } |
| 1882 |
} |
| 1883 |
\exp_args:NNe |
| 1884 |
\prop_get:NnN |
| 1885 |
\g__pdfmeta_outputintents_prop |
| 1886 |
{ \pdfmeta_standard_item:n { outputintent_A } } |
| 1887 |
\l__pdfmeta_tmpb_tl |
| 1888 |
\prop_if_exist:cTF {c__pdfmeta_colorprofile_\l__pdfmeta_tmpb_tl} |
| 1889 |
{ |
| 1890 |
\exp_args:NV \__pdfmeta_embed_colorprofile:n \l__pdfmeta_tmpb_tl |
| 1891 |
\prop_map_inline:Nn \g__pdfmeta_outputintents_prop |
| 1892 |
{ |
| 1893 |
\exp_args:NV |
| 1894 |
\__pdfmeta_write_outputintent:nn |
| 1895 |
\l__pdfmeta_tmpb_tl |
| 1896 |
{ #1 } |
| 1897 |
} |
| 1898 |
} |
| 1899 |
{ |
| 1900 |
\msg_warning:nne{pdfmeta}{colorprofile-undefined}{\l__pdfmeta_tmpb_tl} |
| 1901 |
} |
| 1902 |
} |
| 1903 |
} |
| 1904 |
\cs_new_protected:Npn \pdfmeta_set_regression_data: |
| 1905 |
{ \__pdf_backend_set_regression_data: } |
| 1906 |
|
| 1907 |
\bool_new:N\g__pdfmeta_xmp_bool |
| 1908 |
\bool_gset_true:N \g__pdfmeta_xmp_bool |
| 1909 |
\hook_gput_code:nnn{pdfmanagement/add}{pdfmanagement} |
| 1910 |
{ |
| 1911 |
\pdfmanagement_add:nne {Info}{Producer}{(\c_sys_engine_exec_str-\c_sys_engine_version_str)} |
| 1912 |
\pdfmanagement_add:nne {Info}{Creator}{(LaTeX)} |
| 1913 |
} |
| 1914 |
\cs_generate_variant:Nn\pdf_version_gset:n{e} |
| 1915 |
\cs_new_protected:Nn\__pdfmeta_force_standard_pdfversion: |
| 1916 |
{ |
| 1917 |
\pdfmeta_standard_verify:nnF { min_pdf_version } |
| 1918 |
{ \pdf_version: } |
| 1919 |
{ |
| 1920 |
\pdfmeta_standard_verify:nTF { max_pdf_version } |
| 1921 |
{ |
| 1922 |
\pdf_version_gset:n { 2.0 } |
| 1923 |
} |
| 1924 |
{ |
| 1925 |
\pdf_version_gset:e{ \pdfmeta_standard_item:n{ max_pdf_version } } |
| 1926 |
} |
| 1927 |
} |
| 1928 |
\pdfmeta_standard_verify:nnF { max_pdf_version } |
| 1929 |
{ \pdf_version: } |
| 1930 |
{ |
| 1931 |
\pdf_version_gset:e{ \pdfmeta_standard_item:n{ max_pdf_version } } |
| 1932 |
} |
| 1933 |
} |
| 1934 |
\cs_new_protected:Npn \__pdfmeta_check_standard_pdfversion: |
| 1935 |
{ |
| 1936 |
\clist_map_inline:nn{A,UA,X} |
| 1937 |
{ |
| 1938 |
\pdfmeta_standard_family:nn { ##1 } |
| 1939 |
{ |
| 1940 |
\pdfmeta_standard_verify:nnF { min_pdf_version } |
| 1941 |
{ \pdf_version: } |
| 1942 |
{ \msg_warning:nneee {pdf}{wrong-pdfversion} %TODO make error |
| 1943 |
{\pdf_version:}{low} |
| 1944 |
{ |
| 1945 |
\pdfmeta_standard_item:n{name} |
| 1946 |
} |
| 1947 |
} |
| 1948 |
\pdfmeta_standard_verify:nnF { max_pdf_version } |
| 1949 |
{ \pdf_version: } |
| 1950 |
{ \msg_warning:nneee {pdf}{wrong-pdfversion} |
| 1951 |
{\pdf_version:}{high} |
| 1952 |
{ |
| 1953 |
\pdfmeta_standard_item:n{name} |
| 1954 |
} |
| 1955 |
} |
| 1956 |
} |
| 1957 |
} |
| 1958 |
} |
| 1959 |
\keys_define:nn { document / metadata } |
| 1960 |
{ |
| 1961 |
_pdfstandard .choices:nn = |
| 1962 |
{A-1B,A-2A,A-2B,A-2U,A-3A,A-3B,A-3U,A-4,A-4F,A-4E} |
| 1963 |
{ |
| 1964 |
\prop_gset_eq:Nc \g__pdfmeta_standard_A_prop { g__pdfmeta_standard_pdf/#1 _prop } |
| 1965 |
\prop_gset_eq:NN \g__pdfmeta_standard_prop \g__pdfmeta_standard_A_prop |
| 1966 |
\__pdfmeta_force_standard_pdfversion: |
| 1967 |
\AddToDocumentProperties [document]{pdfstandard}{#1} |
| 1968 |
}, |
| 1969 |
_pdfstandard / unknown .code:n = |
| 1970 |
{ |
| 1971 |
\msg_error:nnn{pdf}{unknown-standard}{#1} |
| 1972 |
}, |
| 1973 |
_pdfstandard / X-4 .code:n = |
| 1974 |
{ |
| 1975 |
\prop_gset_eq:Nc \g__pdfmeta_standard_X_prop { g__pdfmeta_standard_pdf/X-4_prop } |
| 1976 |
\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-4} |
| 1977 |
\__pdfmeta_xmp_add_pdfxid: |
| 1978 |
}, |
| 1979 |
_pdfstandard / X-4P .code:n = |
| 1980 |
{ |
| 1981 |
\prop_gset_eq:Nc \g__pdfmeta_standard_X_prop { g__pdfmeta_standard_pdf/X-4P_prop } |
| 1982 |
\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-4p} |
| 1983 |
\__pdfmeta_xmp_add_pdfxid: |
| 1984 |
}, |
| 1985 |
_pdfstandard / X-5G .code:n = |
| 1986 |
{ |
| 1987 |
\prop_gset_eq:Nc \g__pdfmeta_standard_X_prop { g__pdfmeta_standard_pdf/X-5G_prop } |
| 1988 |
\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-5g} |
| 1989 |
\__pdfmeta_xmp_add_pdfxid: |
| 1990 |
}, |
| 1991 |
_pdfstandard / X-5N .code:n = |
| 1992 |
{ |
| 1993 |
\prop_gset_eq:Nc \g__pdfmeta_standard_X_prop { g__pdfmeta_standard_pdf/X-5N_prop } |
| 1994 |
\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-5n} |
| 1995 |
\__pdfmeta_xmp_add_pdfxid: |
| 1996 |
}, |
| 1997 |
_pdfstandard / X-5PG .code:n = |
| 1998 |
{ |
| 1999 |
\prop_gset_eq:Nc \g__pdfmeta_standard_X_prop { g__pdfmeta_standard_pdf/X-5PG_prop } |
| 2000 |
\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-5pg} |
| 2001 |
\__pdfmeta_xmp_add_pdfxid: |
| 2002 |
}, |
| 2003 |
_pdfstandard / X-6 .code:n = |
| 2004 |
{ |
| 2005 |
\prop_gset_eq:Nc \g__pdfmeta_standard_X_prop { g__pdfmeta_standard_pdf/X-6_prop } |
| 2006 |
\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-6} |
| 2007 |
\__pdfmeta_xmp_add_pdfxid: |
| 2008 |
}, |
| 2009 |
_pdfstandard / X-6N .code:n = |
| 2010 |
{ |
| 2011 |
\prop_gset_eq:Nc \g__pdfmeta_standard_X_prop { g__pdfmeta_standard_pdf/X-6N_prop } |
| 2012 |
\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-6n} |
| 2013 |
\__pdfmeta_xmp_add_pdfxid: |
| 2014 |
}, |
| 2015 |
_pdfstandard / X-6P .code:n = |
| 2016 |
{ |
| 2017 |
\prop_gset_eq:Nc \g__pdfmeta_standard_X_prop { g__pdfmeta_standard_pdf/X-6P_prop } |
| 2018 |
\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-6p} |
| 2019 |
\__pdfmeta_xmp_add_pdfxid: |
| 2020 |
}, |
| 2021 |
_pdfstandard / UA-1 .code:n = |
| 2022 |
{ |
| 2023 |
\prop_gset_eq:Nc \g__pdfmeta_standard_UA_prop { g__pdfmeta_standard_pdf/UA-1_prop } |
| 2024 |
\pdfmeta_standard_family:nn{UA}{ \__pdfmeta_force_standard_pdfversion: } |
| 2025 |
\AddToDocumentProperties [document]{pdfstandard-UA}{{1}{}} |
| 2026 |
\AddToHook{begindocument/before} |
| 2027 |
{ |
| 2028 |
\prop_gput:Nnn \g__pdfmeta_standard_prop {omit_CID}{} |
| 2029 |
} |
| 2030 |
}, |
| 2031 |
_pdfstandard / UA-2 .code:n = |
| 2032 |
{ |
| 2033 |
\prop_gset_eq:Nc \g__pdfmeta_standard_UA_prop { g__pdfmeta_standard_pdf/UA-2_prop } |
| 2034 |
\pdfmeta_standard_family:nn{UA}{\__pdfmeta_force_standard_pdfversion:} |
| 2035 |
\AddToDocumentProperties [document]{pdfstandard-UA}{{2}{2024}} |
| 2036 |
%\AddToHook{begindocument/before} |
| 2037 |
%{\prop_gput:Nnn \g__pdfmeta_standard_prop {Trailer_no_Info}{}} |
| 2038 |
\AddToHook{begindocument/before} |
| 2039 |
{ |
| 2040 |
\__pdfmeta_xmp_wtpdf_accessibility_declaration: |
| 2041 |
\__pdfmeta_xmp_wtpdf_reuse_declaration: |
| 2042 |
\cs_set_eq:NN\__pdfmeta_xmp_wtpdf_accessibility_declaration:\prg_do_nothing: |
| 2043 |
\cs_set_eq:NN\__pdfmeta_xmp_wtpdf_reuse_declaration:\prg_do_nothing: |
| 2044 |
} |
| 2045 |
}, |
| 2046 |
xmp .choice:, |
| 2047 |
xmp / true .code:n = { \bool_gset_true:N \g__pdfmeta_xmp_bool }, |
| 2048 |
xmp / false .code:n = { \bool_gset_false:N \g__pdfmeta_xmp_bool}, |
| 2049 |
xmp .default:n = true, |
| 2050 |
xmp / wtpdf .code:n = |
| 2051 |
{ |
| 2052 |
\keys_set:nn {__pdfmeta/xmp}{#1} |
| 2053 |
}, |
| 2054 |
} |
| 2055 |
\keys_define:nn {__pdfmeta/xmp} |
| 2056 |
{ |
| 2057 |
reuse .choice:, |
| 2058 |
reuse / true .code:n = \__pdfmeta_xmp_wtpdf_reuse_declaration:, |
| 2059 |
reuse / false .code:n = |
| 2060 |
{ |
| 2061 |
\cs_set_eq:NN \__pdfmeta_xmp_wtpdf_reuse_declaration: \prg_do_nothing: |
| 2062 |
}, |
| 2063 |
accessibility .choice:, |
| 2064 |
accessibility / true .code:n = \__pdfmeta_xmp_wtpdf_accessibility_declaration:, |
| 2065 |
accessibility /false .code:n = |
| 2066 |
{ |
| 2067 |
\cs_set_eq:NN \__pdfmeta_xmp_wtpdf_accessibility_declaration: \prg_do_nothing: |
| 2068 |
}, |
| 2069 |
} |
| 2070 |
\bool_new:N \g__pdfmeta_xmp_export_bool |
| 2071 |
\str_new:N \g__pdfmeta_xmp_export_str |
| 2072 |
|
| 2073 |
\keys_define:nn { document / metadata } |
| 2074 |
{ |
| 2075 |
,debug .code:n = |
| 2076 |
{ |
| 2077 |
\keys_set:nn { document / metadata / debug } {#1} |
| 2078 |
} |
| 2079 |
,debug / xmp-export .choice: |
| 2080 |
,debug / xmp-export / true .code:n= |
| 2081 |
{ |
| 2082 |
\bool_gset_true:N \g__pdfmeta_xmp_export_bool |
| 2083 |
\str_gset_eq:NN \g__pdfmeta_xmp_export_str \c_sys_jobname_str |
| 2084 |
} |
| 2085 |
,debug / xmp-export / false .code:n = |
| 2086 |
{ |
| 2087 |
\bool_gset_false:N \g__pdfmeta_xmp_export_bool |
| 2088 |
} |
| 2089 |
,debug / xmp-export /unknown .code:n = |
| 2090 |
{ |
| 2091 |
\bool_gset_true:N \g__pdfmeta_xmp_export_bool |
| 2092 |
\str_gset:Nn \g__pdfmeta_xmp_export_str { #1 } |
| 2093 |
} |
| 2094 |
,debug / xmp-export .default:n = true |
| 2095 |
} |
| 2096 |
\msg_new:nnn{pdfmeta}{xmp-defined}{The~XMP~#1~`#2`~is~already~declared} |
| 2097 |
\msg_new:nnn{pdfmeta}{xmp-undefined}{The~XMP~#1~`#2`~is~undefined} |
| 2098 |
\msg_new:nnn{pdfmeta}{colorprofile-undefined}{The~colorprofile~`#1`~is~unknown} |
| 2099 |
\bool_lazy_or:nnTF |
| 2100 |
{ \sys_if_engine_luatex_p: } |
| 2101 |
{ \sys_if_engine_xetex_p: } |
| 2102 |
{ |
| 2103 |
\cs_new:Npn \__pdfmeta_xmp_generate_bom: |
| 2104 |
{ \char_generate:nn {"FEFF}{12} } |
| 2105 |
} |
| 2106 |
{ |
| 2107 |
\cs_new:Npn \__pdfmeta_xmp_generate_bom: |
| 2108 |
{ |
| 2109 |
\char_generate:nn {"EF}{12} |
| 2110 |
\char_generate:nn {"BB}{12} |
| 2111 |
\char_generate:nn {"BF}{12} |
| 2112 |
} |
| 2113 |
} |
| 2114 |
\int_new:N \l__pdfmeta_xmp_indent_int |
| 2115 |
\cs_new:Npn \__pdfmeta_xmp_indent: |
| 2116 |
{ |
| 2117 |
\iow_newline: |
| 2118 |
\prg_replicate:nn {\l__pdfmeta_xmp_indent_int}{\c_space_tl} |
| 2119 |
} |
| 2120 |
|
| 2121 |
\cs_new:Npn \__pdfmeta_xmp_indent:n #1 |
| 2122 |
{ |
| 2123 |
\iow_newline: |
| 2124 |
\prg_replicate:nn {#1}{\c_space_tl} |
| 2125 |
} |
| 2126 |
|
| 2127 |
\cs_new_protected:Npn \__pdfmeta_xmp_incr_indent: |
| 2128 |
{ |
| 2129 |
\int_incr:N \l__pdfmeta_xmp_indent_int |
| 2130 |
} |
| 2131 |
|
| 2132 |
\cs_new_protected:Npn \__pdfmeta_xmp_decr_indent: |
| 2133 |
{ |
| 2134 |
\int_decr:N \l__pdfmeta_xmp_indent_int |
| 2135 |
} |
| 2136 |
\regex_new:N \l__pdfmeta_xmp_date_regex |
| 2137 |
\regex_set:Nn \l__pdfmeta_xmp_date_regex |
| 2138 |
{D:(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?(\d{2})?([Z\+\-])?(?:(\d{2})\')?(?:(\d{2})\')?} |
| 2139 |
\cs_new_protected:Npn \__pdfmeta_xmp_date_split:nN #1 #2 %#1 date, #2 seq |
| 2140 |
{ |
| 2141 |
\regex_split:NnN \l__pdfmeta_xmp_date_regex {#1} #2 |
| 2142 |
} |
| 2143 |
\cs_generate_variant:Nn \__pdfmeta_xmp_date_split:nN {VN,eN} |
| 2144 |
|
| 2145 |
\cs_new:Npn\__pdfmeta_xmp_print_date:N #1 % seq |
| 2146 |
{ |
| 2147 |
\tl_if_blank:eTF { \seq_item:Nn #1 {1} } |
| 2148 |
{ |
| 2149 |
\seq_item:Nn #1 {2} %year |
| 2150 |
- |
| 2151 |
\seq_item:Nn #1 {3} %month |
| 2152 |
- |
| 2153 |
\seq_item:Nn #1 {4} % day |
| 2154 |
\tl_if_blank:eF |
| 2155 |
{ \seq_item:Nn #1 {5} } |
| 2156 |
{ T \seq_item:Nn #1 {5} } %hour |
| 2157 |
\tl_if_blank:eF |
| 2158 |
{ \seq_item:Nn #1 {6} } |
| 2159 |
{ : \seq_item:Nn #1 {6} } %minutes |
| 2160 |
\tl_if_blank:eF |
| 2161 |
{ \seq_item:Nn #1 {7} } |
| 2162 |
{ : \seq_item:Nn #1 {7} } %seconds |
| 2163 |
\seq_item:Nn #1 {8} %Z,+,- |
| 2164 |
\seq_item:Nn #1 {9} |
| 2165 |
\tl_if_blank:eF |
| 2166 |
{ \seq_item:Nn #1 {10} } |
| 2167 |
{ : \seq_item:Nn #1 {10} } |
| 2168 |
} |
| 2169 |
{ |
| 2170 |
\seq_item:Nn #1 {1} |
| 2171 |
} |
| 2172 |
} |
| 2173 |
\tl_new:N \l__pdfmeta_xmp_currentdate_tl |
| 2174 |
\seq_new:N \l__pdfmeta_xmp_currentdate_seq |
| 2175 |
\cs_new_protected:Npn \__pdfmeta_xmp_date_get:nNN #1 #2 #3 |
| 2176 |
%#1 property, #2 tl var with PDF date, #3 seq for split date |
| 2177 |
{ |
| 2178 |
\tl_set:Ne #2 { \pdfmanagement_get_documentproperty:n{#1} } |
| 2179 |
\tl_if_blank:VTF #2 |
| 2180 |
{ |
| 2181 |
\seq_set_eq:NN #3 \l__pdfmeta_xmp_currentdate_seq |
| 2182 |
\tl_set_eq:NN #2 \l__pdfmeta_xmp_currentdate_tl |
| 2183 |
} |
| 2184 |
{ |
| 2185 |
\__pdfmeta_xmp_date_split:VN #2 #3 |
| 2186 |
} |
| 2187 |
} |
| 2188 |
\cs_new_protected:Npn \__pdfmeta_xmp_create_uuid:nN #1 #2 |
| 2189 |
{ |
| 2190 |
\str_set:Ne#2 {\str_lowercase:f{\tex_mdfivesum:D{#1}}} |
| 2191 |
\str_set:Ne#2 |
| 2192 |
{ uuid: |
| 2193 |
\str_range:Nnn #2{1}{8} |
| 2194 |
-\str_range:Nnn#2{9}{12} |
| 2195 |
-4\str_range:Nnn#2{13}{15} |
| 2196 |
-8\str_range:Nnn#2{16}{18} |
| 2197 |
-\str_range:Nnn#2{19}{30} |
| 2198 |
} |
| 2199 |
} |
| 2200 |
\cs_new_protected:Npn \__pdfmeta_xmp_sanitize:nN #1 #2 |
| 2201 |
{ |
| 2202 |
\group_begin: |
| 2203 |
\text_declare_purify_equivalent:Nn \& {\tl_to_str:N & } |
| 2204 |
\text_declare_purify_equivalent:Nn \texttilde {\c_tilde_str} |
| 2205 |
\tl_set:Ne \l__pdfmeta_tmpa_tl { \text_purify:n {#1} } |
| 2206 |
\str_gset:Ne \g__pdfmeta_tmpa_str { \tl_to_str:N \l__pdfmeta_tmpa_tl } |
| 2207 |
\str_greplace_all:Nnn\g__pdfmeta_tmpa_str {&}{&} |
| 2208 |
\str_greplace_all:Nnn\g__pdfmeta_tmpa_str {<}{<} |
| 2209 |
\str_greplace_all:Nnn\g__pdfmeta_tmpa_str {>}{>} |
| 2210 |
\str_greplace_all:Nnn\g__pdfmeta_tmpa_str {"}{"} |
| 2211 |
\group_end: |
| 2212 |
\str_set_eq:NN #2 \g__pdfmeta_tmpa_str |
| 2213 |
} |
| 2214 |
|
| 2215 |
\cs_generate_variant:Nn\__pdfmeta_xmp_sanitize:nN {VN} |
| 2216 |
\tl_new:N \l__pdfmeta_xmp_doclang_tl |
| 2217 |
\tl_new:N \l__pdfmeta_xmp_metalang_tl |
| 2218 |
\regex_new:N\l__pdfmeta_xmp_lang_regex |
| 2219 |
\regex_set:Nn\l__pdfmeta_xmp_lang_regex {\A\[([A-Za-z\-]+)\](.*)} |
| 2220 |
\cs_new_protected:Npn \__pdfmeta_xmp_lang_get:nNN #1 #2 #3 |
| 2221 |
{ |
| 2222 |
\regex_extract_once:NnN \l__pdfmeta_xmp_lang_regex {#1}\l__pdfmeta_tmpa_seq |
| 2223 |
\seq_if_empty:NTF \l__pdfmeta_tmpa_seq |
| 2224 |
{ |
| 2225 |
\tl_set:Nn #2 \l__pdfmeta_xmp_metalang_tl |
| 2226 |
\tl_set:Nn #3 {#1} |
| 2227 |
} |
| 2228 |
{ |
| 2229 |
\tl_set:Ne #2 {\seq_item:Nn\l__pdfmeta_tmpa_seq{2}} |
| 2230 |
\tl_set:Ne #3 {\seq_item:Nn\l__pdfmeta_tmpa_seq{3}} |
| 2231 |
} |
| 2232 |
} |
| 2233 |
\cs_generate_variant:Nn \__pdfmeta_xmp_lang_get:nNN {eNN,VNN} |
| 2234 |
|
| 2235 |
\tl_new:N \g__pdfmeta_xmp_packet_tl |
| 2236 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_chunk:n #1 |
| 2237 |
{ |
| 2238 |
\tl_gput_right:Ne\g__pdfmeta_xmp_packet_tl |
| 2239 |
{ |
| 2240 |
\__pdfmeta_xmp_indent: \exp_not:n{#1} |
| 2241 |
} |
| 2242 |
} |
| 2243 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_chunk:n {e} |
| 2244 |
|
| 2245 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_chunk:nN #1 #2 |
| 2246 |
{ |
| 2247 |
\tl_put_right:Ne#2 |
| 2248 |
{ |
| 2249 |
\__pdfmeta_xmp_indent: \exp_not:n{#1} |
| 2250 |
} |
| 2251 |
} |
| 2252 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_chunk:nN {eN} |
| 2253 |
|
| 2254 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_open:nn #1 #2 %#1 prefix #2 name |
| 2255 |
{ |
| 2256 |
\__pdfmeta_xmp_add_packet_chunk:n {<#1:#2>} |
| 2257 |
\__pdfmeta_xmp_incr_indent: |
| 2258 |
} |
| 2259 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_open:nn {ne} |
| 2260 |
|
| 2261 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_open_attr:nnn #1 #2 #3 |
| 2262 |
%#1 prefix #2 name #3 attr |
| 2263 |
{ |
| 2264 |
\__pdfmeta_xmp_add_packet_chunk:n {<#1:#2~#3>} |
| 2265 |
\__pdfmeta_xmp_incr_indent: |
| 2266 |
} |
| 2267 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_open_attr:nnn {nne} |
| 2268 |
|
| 2269 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_close:nn #1 #2 %#1 prefix #2:name |
| 2270 |
{ |
| 2271 |
\__pdfmeta_xmp_decr_indent: |
| 2272 |
\__pdfmeta_xmp_add_packet_chunk:n {</#1:#2>} |
| 2273 |
} |
| 2274 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_line:nnn #1 #2 #3 |
| 2275 |
%#1 prefix #2 name #3 content |
| 2276 |
{ |
| 2277 |
\tl_if_blank:nF {#3} |
| 2278 |
{ |
| 2279 |
\__pdfmeta_xmp_sanitize:nN {#3}\l__pdfmeta_tmpa_str |
| 2280 |
\__pdfmeta_xmp_add_packet_chunk:e {<#1:#2>\l__pdfmeta_tmpa_str</#1:#2>} |
| 2281 |
} |
| 2282 |
} |
| 2283 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_line:nnn {nne,nnV,nee} |
| 2284 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_line:nnnN #1 #2 #3 #4 |
| 2285 |
%#1 prefix #2 name #3 content #4 tl_var to prebuilt. |
| 2286 |
{ |
| 2287 |
\tl_if_blank:nF {#3} |
| 2288 |
{ |
| 2289 |
\__pdfmeta_xmp_sanitize:nN {#3}\l__pdfmeta_tmpa_str |
| 2290 |
\__pdfmeta_xmp_add_packet_chunk:eN {<#1:#2>\l__pdfmeta_tmpa_str</#1:#2>} #4 |
| 2291 |
} |
| 2292 |
} |
| 2293 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_line:nnnN {nneN} |
| 2294 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_line_attr:nnnn #1 #2 #3 #4 |
| 2295 |
%#1 prefix #2 name #3 attribute #4 content |
| 2296 |
{ |
| 2297 |
\tl_if_blank:nF {#4} |
| 2298 |
{ |
| 2299 |
\__pdfmeta_xmp_sanitize:nN {#4}\l__pdfmeta_tmpa_str |
| 2300 |
\__pdfmeta_xmp_add_packet_chunk:e {<#1:#2~#3>\l__pdfmeta_tmpa_str</#1:#2>} |
| 2301 |
} |
| 2302 |
} |
| 2303 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_line_attr:nnnn {nnee,nneV} |
| 2304 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_line_default:nnnn #1 #2 #3 #4 |
| 2305 |
% #1 prefix #2 name #3 default #4 content |
| 2306 |
{ |
| 2307 |
\tl_if_blank:nTF { #4 } |
| 2308 |
{ |
| 2309 |
\tl_set:Nn \l__pdfmeta_tmpa_tl {#3} |
| 2310 |
} |
| 2311 |
{ |
| 2312 |
\tl_set:Nn \l__pdfmeta_tmpa_tl {#4} |
| 2313 |
} |
| 2314 |
\__pdfmeta_xmp_add_packet_line:nnV {#1}{#2}\l__pdfmeta_tmpa_tl |
| 2315 |
} |
| 2316 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_line_default:nnnn {nnee} |
| 2317 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_list_simple:nnnn #1 #2 #3 #4 |
| 2318 |
%#1 prefix, #2 name, #3 type (Seq/Bag/Alt) #4 a clist |
| 2319 |
{ |
| 2320 |
\clist_if_empty:nF { #4 } |
| 2321 |
{ |
| 2322 |
\__pdfmeta_xmp_add_packet_open:nn {#1}{#2} |
| 2323 |
\__pdfmeta_xmp_add_packet_open:nn {rdf}{#3} |
| 2324 |
\clist_map_inline:nn {#4} |
| 2325 |
{ |
| 2326 |
\__pdfmeta_xmp_add_packet_line:nnn |
| 2327 |
{rdf}{li}{##1} |
| 2328 |
} |
| 2329 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{#3} |
| 2330 |
\__pdfmeta_xmp_add_packet_close:nn {#1}{#2} |
| 2331 |
} |
| 2332 |
} |
| 2333 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_list_simple:nnnn {nnnV,nnne} |
| 2334 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_list:nnnn #1 #2 #3 #4 |
| 2335 |
%#1 prefix, #2 name, #3 type (Seq/Bag/Alt) #4 a clist |
| 2336 |
{ |
| 2337 |
\clist_if_empty:nF { #4 } |
| 2338 |
{ |
| 2339 |
\__pdfmeta_xmp_add_packet_open:nn {#1}{#2} |
| 2340 |
\__pdfmeta_xmp_add_packet_open:nn {rdf}{#3} |
| 2341 |
\clist_map_inline:nn {#4} |
| 2342 |
{ |
| 2343 |
\__pdfmeta_xmp_lang_get:nNN {##1}\l__pdfmeta_tmpa_tl\l__pdfmeta_tmpb_tl |
| 2344 |
\tl_if_eq:eeT{\l__pdfmeta_tmpa_tl}{\l__pdfmeta_xmp_metalang_tl} |
| 2345 |
{ |
| 2346 |
\__pdfmeta_xmp_add_packet_line_attr:nneV |
| 2347 |
{rdf}{li}{xml:lang="x-default" }\l__pdfmeta_tmpb_tl |
| 2348 |
\__pdfmeta_xmp_add_packet_line_attr:nneV |
| 2349 |
{rdf}{li}{xml:lang="\l__pdfmeta_tmpa_tl" }\l__pdfmeta_tmpb_tl |
| 2350 |
} |
| 2351 |
} |
| 2352 |
\clist_map_inline:nn {#4} |
| 2353 |
{ |
| 2354 |
\__pdfmeta_xmp_lang_get:nNN {##1}\l__pdfmeta_tmpa_tl\l__pdfmeta_tmpb_tl |
| 2355 |
\tl_if_eq:eeF{\l__pdfmeta_tmpa_tl}{\l__pdfmeta_xmp_metalang_tl} |
| 2356 |
{ |
| 2357 |
\__pdfmeta_xmp_add_packet_line_attr:nneV |
| 2358 |
{rdf}{li}{xml:lang="\l__pdfmeta_tmpa_tl" }\l__pdfmeta_tmpb_tl |
| 2359 |
} |
| 2360 |
} |
| 2361 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{#3} |
| 2362 |
\__pdfmeta_xmp_add_packet_close:nn {#1}{#2} |
| 2363 |
} |
| 2364 |
} |
| 2365 |
\cs_generate_variant:Nn \__pdfmeta_xmp_add_packet_list:nnnn {nnne} |
| 2366 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_packet: |
| 2367 |
{ |
| 2368 |
\tl_set:Ne \l__pdfmeta_xmp_doclang_tl {\pdfmanagement_get_documentproperty:n{document/lang}} |
| 2369 |
\tl_set:Ne \l__pdfmeta_xmp_metalang_tl {\pdfmanagement_get_documentproperty:n{hyperref/pdfmetalang}} |
| 2370 |
\tl_if_blank:VT \l__pdfmeta_xmp_metalang_tl |
| 2371 |
{ \cs_set_eq:NN \l__pdfmeta_xmp_metalang_tl\l__pdfmeta_xmp_doclang_tl} |
| 2372 |
\__pdfmeta_xmp_build_iptc_data:N \l__pdfmeta_xmp_iptc_data_tl |
| 2373 |
\tl_if_empty:NT \l__pdfmeta_xmp_iptc_data_tl |
| 2374 |
{ |
| 2375 |
\seq_remove_all:Nn \l__pdfmeta_xmp_schema_seq { Iptc4xmpCore } |
| 2376 |
} |
| 2377 |
\__pdfmeta_xmp_add_packet_chunk:e |
| 2378 |
{<?xpacket~begin="\__pdfmeta_xmp_generate_bom:"~id="W5M0MpCehiHzreSzNTczkc9d"?>} |
| 2379 |
\__pdfmeta_xmp_add_packet_open:nn{x}{xmpmeta~xmlns:x="adobe:ns:meta/"} |
| 2380 |
\__pdfmeta_xmp_add_packet_open:ne{rdf} |
| 2381 |
{RDF~xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns\c_hash_str"} |
| 2382 |
\__pdfmeta_xmp_add_packet_open_attr:nne |
| 2383 |
{rdf}{Description}{rdf:about="" \g__pdfmeta_xmp_xmlns_tl} |
| 2384 |
\__pdfmeta_xmp_add_packet_open:nn{pdfaExtension}{schemas} |
| 2385 |
\__pdfmeta_xmp_add_packet_open:nn {rdf}{Bag} |
| 2386 |
\seq_map_inline:Nn \l__pdfmeta_xmp_schema_seq |
| 2387 |
{ |
| 2388 |
\tl_use:c { g__pdfmeta_xmp_schema_##1_tl } |
| 2389 |
} |
| 2390 |
\__pdfmeta_xmp_add_packet_close:nn {rdf}{Bag} |
| 2391 |
\__pdfmeta_xmp_add_packet_close:nn {pdfaExtension}{schemas} |
| 2392 |
% data |
| 2393 |
\__pdfmeta_xmp_build_pdf: |
| 2394 |
\__pdfmeta_xmp_build_xmpRights: |
| 2395 |
\__pdfmeta_xmp_build_standards: %pdfaid,pdfxid,pdfuaid |
| 2396 |
\__pdfmeta_xmp_build_pdfd: |
| 2397 |
\__pdfmeta_xmp_build_dc: |
| 2398 |
\__pdfmeta_xmp_build_photoshop: |
| 2399 |
\__pdfmeta_xmp_build_xmp: |
| 2400 |
\__pdfmeta_xmp_build_xmpMM: |
| 2401 |
\__pdfmeta_xmp_build_prism: |
| 2402 |
\__pdfmeta_xmp_build_iptc: |
| 2403 |
\__pdfmeta_xmp_build_tdm: |
| 2404 |
\__pdfmeta_xmp_build_user: %user additions |
| 2405 |
% end |
| 2406 |
\__pdfmeta_xmp_add_packet_close:nn {rdf}{Description} |
| 2407 |
\__pdfmeta_xmp_add_packet_close:nn {rdf}{RDF} |
| 2408 |
\__pdfmeta_xmp_add_packet_close:nn {x}{xmpmeta} |
| 2409 |
\int_set:Nn \l__pdfmeta_xmp_indent_int{20} |
| 2410 |
\prg_replicate:nn{10}{\__pdfmeta_xmp_add_packet_chunk:n {}} |
| 2411 |
\int_zero:N \l__pdfmeta_xmp_indent_int |
| 2412 |
\__pdfmeta_xmp_add_packet_chunk:n {<?xpacket~end="w"?>} |
| 2413 |
} |
| 2414 |
|
| 2415 |
|
| 2416 |
\str_new:N \g__pdfmeta_xmp_xmlns_tl |
| 2417 |
\prop_new:N \g__pdfmeta_xmp_xmlns_prop |
| 2418 |
\cs_new_protected:Npn \__pdfmeta_xmp_xmlns_new:nn #1 #2 |
| 2419 |
{ |
| 2420 |
\prop_gput:Nnn \g__pdfmeta_xmp_xmlns_prop {#1}{#2} |
| 2421 |
\tl_gput_right:Ne \g__pdfmeta_xmp_xmlns_tl |
| 2422 |
{ |
| 2423 |
\__pdfmeta_xmp_indent:n{4} xmlns:\exp_not:n{#1="#2"} |
| 2424 |
} |
| 2425 |
} |
| 2426 |
\__pdfmeta_xmp_xmlns_new:nn {pdf} {http://ns.adobe.com/pdf/1.3/} |
| 2427 |
\__pdfmeta_xmp_xmlns_new:nn {xmpRights}{http://ns.adobe.com/xap/1.0/rights/} |
| 2428 |
\__pdfmeta_xmp_xmlns_new:nn {dc} {http://purl.org/dc/elements/1.1/} |
| 2429 |
\__pdfmeta_xmp_xmlns_new:nn {photoshop}{http://ns.adobe.com/photoshop/1.0/} |
| 2430 |
\__pdfmeta_xmp_xmlns_new:nn {xmp} {http://ns.adobe.com/xap/1.0/} |
| 2431 |
\__pdfmeta_xmp_xmlns_new:nn {xmpMM} {http://ns.adobe.com/xap/1.0/mm/} |
| 2432 |
\__pdfmeta_xmp_xmlns_new:nn {stEvt} |
| 2433 |
{http://ns.adobe.com/xap/1.0/sType/ResourceEvent\c_hash_str} |
| 2434 |
\__pdfmeta_xmp_xmlns_new:nn {pdfaid} {http://www.aiim.org/pdfa/ns/id/} |
| 2435 |
\__pdfmeta_xmp_xmlns_new:nn {pdfuaid} {http://www.aiim.org/pdfua/ns/id/} |
| 2436 |
\__pdfmeta_xmp_xmlns_new:nn {pdfx} {http://ns.adobe.com/pdfx/1.3/} |
| 2437 |
\__pdfmeta_xmp_xmlns_new:nn {prism} {http://prismstandard.org/namespaces/basic/3.0/} |
| 2438 |
\__pdfmeta_xmp_xmlns_new:nn {stFnt} {http://ns.adobe.com/xap/1.0/sType/Font\c_hash_str} |
| 2439 |
\__pdfmeta_xmp_xmlns_new:nn {Iptc4xmpCore}{http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/} |
| 2440 |
\__pdfmeta_xmp_xmlns_new:nn {pdfaExtension}{http://www.aiim.org/pdfa/ns/extension/} |
| 2441 |
\__pdfmeta_xmp_xmlns_new:nn {pdfaSchema}{http://www.aiim.org/pdfa/ns/schema\c_hash_str} |
| 2442 |
\__pdfmeta_xmp_xmlns_new:nn {pdfaProperty}{http://www.aiim.org/pdfa/ns/property\c_hash_str} |
| 2443 |
\__pdfmeta_xmp_xmlns_new:nn {pdfaType} {http://www.aiim.org/pdfa/ns/type\c_hash_str} |
| 2444 |
\__pdfmeta_xmp_xmlns_new:nn {pdfaField}{http://www.aiim.org/pdfa/ns/field\c_hash_str} |
| 2445 |
\__pdfmeta_xmp_xmlns_new:nn {tdm}{http://www.w3.org/ns/tdmrep/} |
| 2446 |
|
| 2447 |
\seq_new:N \l__pdfmeta_xmp_schema_seq |
| 2448 |
\cs_new_protected:Npn \__pdfmeta_xmp_schema_new:nnn #1 #2 #3 |
| 2449 |
%#1 name #2 prefix, #3 text |
| 2450 |
{ |
| 2451 |
\tl_if_exist:cTF { g__pdfmeta_xmp_schema_#2_tl } |
| 2452 |
{ |
| 2453 |
\msg_warning:nnnn{pdfmeta}{xmp-defined}{schema}{#2} |
| 2454 |
} |
| 2455 |
{ |
| 2456 |
\seq_put_right:Nn \l__pdfmeta_xmp_schema_seq { #2 } |
| 2457 |
\tl_new:c { g__pdfmeta_xmp_schema_#2_tl } |
| 2458 |
\tl_new:c { g__pdfmeta_xmp_schema_#2_properties_tl } |
| 2459 |
\tl_gput_right:cn { g__pdfmeta_xmp_schema_#2_tl } |
| 2460 |
{ |
| 2461 |
\__pdfmeta_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"} |
| 2462 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaSchema}{schema}{#1} |
| 2463 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaSchema}{prefix}{#2} |
| 2464 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaSchema}{namespaceURI}{#3} |
| 2465 |
\__pdfmeta_xmp_add_packet_open:nn {pdfaSchema}{property} |
| 2466 |
\__pdfmeta_xmp_add_packet_open:nn{rdf}{Seq} |
| 2467 |
\tl_use:c { g__pdfmeta_xmp_schema_#2_properties_tl } |
| 2468 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{Seq} |
| 2469 |
\__pdfmeta_xmp_add_packet_close:nn {pdfaSchema}{property} |
| 2470 |
\cs_if_exist_use:c {__pdfmeta_xmp_schema_#2_additions:} |
| 2471 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{li} |
| 2472 |
} |
| 2473 |
} |
| 2474 |
} |
| 2475 |
\prop_new:N\g__pdfmeta_xmp_schema_property_prop |
| 2476 |
\cs_new_protected:Npn \__pdfmeta_xmp_property_new:nnnnn #1 #2 #3 #4 #5 % |
| 2477 |
%#1 schema #2 name, #3 type, #4 category #5 description |
| 2478 |
{ |
| 2479 |
\tl_if_exist:cTF { g__pdfmeta_xmp_schema_#1_properties_tl } |
| 2480 |
{ |
| 2481 |
\prop_get:NeNF \g__pdfmeta_xmp_schema_property_prop {#1:#2}\l__pdfmeta_tmpa_tl |
| 2482 |
{ |
| 2483 |
\prop_gput:Nee \g__pdfmeta_xmp_schema_property_prop {#1:#2}{#3} |
| 2484 |
\tl_gput_right:cn { g__pdfmeta_xmp_schema_#1_properties_tl } |
| 2485 |
{ |
| 2486 |
\__pdfmeta_xmp_add_packet_open:nn {rdf}{li~rdf:parseType="Resource"} |
| 2487 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaProperty}{name}{#2} |
| 2488 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaProperty}{valueType}{#3} |
| 2489 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaProperty}{category}{#4} |
| 2490 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaProperty}{description}{#5} |
| 2491 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{li} |
| 2492 |
} |
| 2493 |
} |
| 2494 |
} |
| 2495 |
{ |
| 2496 |
\msg_warning:nnnn{pdfmeta}{xmp-undefined}{schema}{#1} |
| 2497 |
} |
| 2498 |
} |
| 2499 |
|
| 2500 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_packet_field:nnn #1 #2 #3 % |
| 2501 |
%#1 name #2 valuetype #3 description |
| 2502 |
{ |
| 2503 |
\__pdfmeta_xmp_add_packet_open_attr:nnn {rdf}{li}{rdf:parseType="Resource"} |
| 2504 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaField}{name}{#1} |
| 2505 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaField}{valueType}{#2} |
| 2506 |
\__pdfmeta_xmp_add_packet_line:nnn {pdfaField}{description}{#3} |
| 2507 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{li} |
| 2508 |
} |
| 2509 |
\__pdfmeta_xmp_schema_new:nnn |
| 2510 |
{XMP~Media~Management~Schema} |
| 2511 |
{xmpMM} |
| 2512 |
{http://ns.adobe.com/xap/1.0/mm/} |
| 2513 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2514 |
{xmpMM} |
| 2515 |
{OriginalDocumentID} |
| 2516 |
{URI} |
| 2517 |
{internal} |
| 2518 |
{The~common~identifier~for~all~versions~and~renditions~of~a~document.} |
| 2519 |
\__pdfmeta_xmp_schema_new:nnn |
| 2520 |
{PDF/A~Identification~Schema} |
| 2521 |
{pdfaid} |
| 2522 |
{http://www.aiim.org/pdfa/ns/id/} |
| 2523 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2524 |
{pdfaid} |
| 2525 |
{year} |
| 2526 |
{Integer} |
| 2527 |
{internal} |
| 2528 |
{Year~of~standard} |
| 2529 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2530 |
{pdfaid} |
| 2531 |
{rev} |
| 2532 |
{Integer} |
| 2533 |
{internal} |
| 2534 |
{Revision~year~of~standard} |
| 2535 |
\__pdfmeta_xmp_schema_new:nnn |
| 2536 |
{PDF/UA~Universal~Accessibility~Schema} |
| 2537 |
{pdfuaid} |
| 2538 |
{http://www.aiim.org/pdfua/ns/id/} |
| 2539 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2540 |
{pdfuaid} |
| 2541 |
{part} |
| 2542 |
{Integer} |
| 2543 |
{internal} |
| 2544 |
{Part~of~ISO~14289~standard} |
| 2545 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2546 |
{pdfuaid} |
| 2547 |
{rev} |
| 2548 |
{Integer} |
| 2549 |
{internal} |
| 2550 |
{Revision~of~ISO~14289~standard} |
| 2551 |
\cs_new_protected:Npn \__pdfmeta_xmp_add_pdfxid: |
| 2552 |
{ |
| 2553 |
\__pdfmeta_xmp_xmlns_new:nn {pdfxid} {http://www.npes.org/pdfx/ns/id/} |
| 2554 |
\__pdfmeta_xmp_schema_new:nnn |
| 2555 |
{PDF/X~ID~Schema} |
| 2556 |
{pdfxid} |
| 2557 |
{http://www.npes.org/pdfx/ns/id/} |
| 2558 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2559 |
{pdfxid} |
| 2560 |
{GTS_PDFXVersion} |
| 2561 |
{Text} |
| 2562 |
{internal} |
| 2563 |
{ID~of~PDF/X~standard} |
| 2564 |
} |
| 2565 |
|
| 2566 |
\__pdfmeta_xmp_schema_new:nnn |
| 2567 |
{PRISM~Basic~Metadata} |
| 2568 |
{prism} |
| 2569 |
{http://prismstandard.org/namespaces/basic/3.0/} |
| 2570 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2571 |
{prism} |
| 2572 |
{complianceProfile} |
| 2573 |
{Text} |
| 2574 |
{internal} |
| 2575 |
{PRISM~specification~compliance~profile~to~which~this~document~adheres} |
| 2576 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2577 |
{prism} |
| 2578 |
{publicationName} |
| 2579 |
{Text} |
| 2580 |
{external} |
| 2581 |
{Publication~name} |
| 2582 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2583 |
{prism} |
| 2584 |
{aggregationType} |
| 2585 |
{Text} |
| 2586 |
{external} |
| 2587 |
{Publication~type} |
| 2588 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2589 |
{prism} |
| 2590 |
{bookEdition} |
| 2591 |
{Text} |
| 2592 |
{external} |
| 2593 |
{Edition~of~the~book~in~which~the~document~was~published} |
| 2594 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2595 |
{prism} |
| 2596 |
{volume} |
| 2597 |
{Text} |
| 2598 |
{external} |
| 2599 |
{Publication~volume~number} |
| 2600 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2601 |
{prism} |
| 2602 |
{number} |
| 2603 |
{Text} |
| 2604 |
{external} |
| 2605 |
{Publication~issue~number~within~a~volume} |
| 2606 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2607 |
{prism} |
| 2608 |
{pageRange} |
| 2609 |
{Text} |
| 2610 |
{external} |
| 2611 |
{Page~range~for~the~document~within~the~print~version~of~its~publication} |
| 2612 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2613 |
{prism} |
| 2614 |
{issn} |
| 2615 |
{Text} |
| 2616 |
{external} |
| 2617 |
{ISSN~for~the~printed~publication~in~which~the~document~was~published} |
| 2618 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2619 |
{prism} |
| 2620 |
{eIssn} |
| 2621 |
{Text} |
| 2622 |
{external} |
| 2623 |
{ISSN~for~the~electronic~publication~in~which~the~document~was~published} |
| 2624 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2625 |
{prism} |
| 2626 |
{isbn} |
| 2627 |
{Text} |
| 2628 |
{external} |
| 2629 |
{ISBN~for~the~publication~in~which~the~document~was~published} |
| 2630 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2631 |
{prism} |
| 2632 |
{doi} |
| 2633 |
{Text} |
| 2634 |
{external} |
| 2635 |
{Digital~Object~Identifier~for~the~document} |
| 2636 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2637 |
{prism} |
| 2638 |
{url} |
| 2639 |
{URL} |
| 2640 |
{external} |
| 2641 |
{URL~at~which~the~document~can~be~found} |
| 2642 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2643 |
{prism} |
| 2644 |
{byteCount} |
| 2645 |
{Integer} |
| 2646 |
{internal} |
| 2647 |
{Approximate~file~size~in~octets} |
| 2648 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2649 |
{prism} |
| 2650 |
{pageCount} |
| 2651 |
{Integer} |
| 2652 |
{internal} |
| 2653 |
{Number~of~pages~in~the~print~version~of~the~document} |
| 2654 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2655 |
{prism} |
| 2656 |
{subtitle} |
| 2657 |
{Text} |
| 2658 |
{external} |
| 2659 |
{Document's~subtitle} |
| 2660 |
\__pdfmeta_xmp_schema_new:nnn |
| 2661 |
{IPTC~Core~Schema} |
| 2662 |
{Iptc4xmpCore} |
| 2663 |
{http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/} |
| 2664 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2665 |
{Iptc4xmpCore} |
| 2666 |
{CreatorContactInfo} |
| 2667 |
{ContactInfo} |
| 2668 |
{external} |
| 2669 |
{Document~creator's~contact~information} |
| 2670 |
\cs_new_protected:cpn { __pdfmeta_xmp_schema_Iptc4xmpCore_additions: } |
| 2671 |
{ |
| 2672 |
\__pdfmeta_xmp_add_packet_open:nn{pdfaSchema}{valueType} |
| 2673 |
\__pdfmeta_xmp_add_packet_open:nn{rdf}{Seq} |
| 2674 |
\__pdfmeta_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"} |
| 2675 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{type}{ContactInfo} |
| 2676 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{namespaceURI} |
| 2677 |
{http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/} |
| 2678 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{prefix}{Iptc4xmpCore} |
| 2679 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{description} |
| 2680 |
{Basic~set~of~information~to~get~in~contact~with~a~person} |
| 2681 |
\__pdfmeta_xmp_add_packet_open:nn{pdfaType}{field} |
| 2682 |
\__pdfmeta_xmp_add_packet_open:nn{rdf}{Seq} |
| 2683 |
\__pdfmeta_xmp_add_packet_field:nnn{CiAdrCity}{Text} |
| 2684 |
{Contact~information~city} |
| 2685 |
\__pdfmeta_xmp_add_packet_field:nnn{CiAdrCtry}{Text} |
| 2686 |
{Contact~information~country} |
| 2687 |
\__pdfmeta_xmp_add_packet_field:nnn{CiAdrExtadr}{Text} |
| 2688 |
{Contact~information~address} |
| 2689 |
\__pdfmeta_xmp_add_packet_field:nnn{CiAdrPcode}{Text} |
| 2690 |
{Contact~information~local~postal~code} |
| 2691 |
\__pdfmeta_xmp_add_packet_field:nnn{CiAdrRegion}{Text} |
| 2692 |
{Contact~information~regional~information~such~as~state~or~province} |
| 2693 |
\__pdfmeta_xmp_add_packet_field:nnn{CiEmailWork}{Text} |
| 2694 |
{Contact~information~email~address(es)} |
| 2695 |
\__pdfmeta_xmp_add_packet_field:nnn{CiTelWork}{Text} |
| 2696 |
{Contact~information~telephone~number(s)} |
| 2697 |
\__pdfmeta_xmp_add_packet_field:nnn{CiUrlWork}{Text} |
| 2698 |
{Contact~information~Web~URL(s)} |
| 2699 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{Seq} |
| 2700 |
\__pdfmeta_xmp_add_packet_close:nn{pdfaType}{field} |
| 2701 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{li} |
| 2702 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{Seq} |
| 2703 |
\__pdfmeta_xmp_add_packet_close:nn{pdfaSchema}{valueType} |
| 2704 |
} |
| 2705 |
\__pdfmeta_xmp_schema_new:nnn |
| 2706 |
{TDMRep} |
| 2707 |
{tdm} |
| 2708 |
{http://www.w3.org/ns/tdmrep/} |
| 2709 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2710 |
{tdm} |
| 2711 |
{reservation} |
| 2712 |
{Closed~Choice~of~Integer} |
| 2713 |
{internal} |
| 2714 |
{TDM~rights~are~reserved~(1)~or~not~reserved~(0)} |
| 2715 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2716 |
{tdm} |
| 2717 |
{policy} |
| 2718 |
{URI} |
| 2719 |
{internal} |
| 2720 |
{URL~pointing~to~a~TDM~Policy~set~by~the~rightsholder} |
| 2721 |
\cs_new_protected:Npn \__pdfmeta_xmp_schema_enable_pdfd: |
| 2722 |
{ |
| 2723 |
\__pdfmeta_xmp_xmlns_new:nn {pdfd}{http://pdfa.org/declarations/} |
| 2724 |
\__pdfmeta_xmp_schema_new:nnn |
| 2725 |
{PDF~Declarations~Schema} |
| 2726 |
{pdfd} |
| 2727 |
{http://pdfa.org/declarations/} |
| 2728 |
\__pdfmeta_xmp_property_new:nnnnn |
| 2729 |
{pdfd} |
| 2730 |
{declarations} |
| 2731 |
{Bag~declaration} |
| 2732 |
{external} |
| 2733 |
{An~unordered~array~of~PDF~Declaration~entries,~where~each~PDF~Declaration~representing~a~statement~of~conformance~with~ an~identified~external~standard~or~profile,~along~with~optional~information~identifying~the~nature~of~the~claim.} |
| 2734 |
\cs_new_protected:cpn { __pdfmeta_xmp_schema_pdfd_additions: } |
| 2735 |
{ |
| 2736 |
\__pdfmeta_xmp_add_packet_open:nn{pdfaSchema}{valueType} |
| 2737 |
\__pdfmeta_xmp_add_packet_open:nn{rdf}{Seq} |
| 2738 |
\__pdfmeta_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"} |
| 2739 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{type}{claim} |
| 2740 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{namespaceURI} |
| 2741 |
{http://pdfa.org/declarations/} |
| 2742 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{prefix}{pdfd} |
| 2743 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{description} |
| 2744 |
{A~structure~describing~properties~of~an~individual claim.} |
| 2745 |
\__pdfmeta_xmp_add_packet_open:nn{pdfaType}{field} |
| 2746 |
\__pdfmeta_xmp_add_packet_open:nn{rdf}{Seq} |
| 2747 |
\__pdfmeta_xmp_add_packet_field:nnn{claimReport}{Text} |
| 2748 |
{A~URL~to~a~report~containing~details~of~the~specific~conformance~claim.} |
| 2749 |
\__pdfmeta_xmp_add_packet_field:nnn{claimCredentials}{Text} |
| 2750 |
{The~claimant's~credentials.} |
| 2751 |
\__pdfmeta_xmp_add_packet_field:nnn{claimDate}{Text} |
| 2752 |
{A~date~identifying~when~the~claim~was~made.} |
| 2753 |
\__pdfmeta_xmp_add_packet_field:nnn{claimBy}{Text} |
| 2754 |
{The~name~of~the~organization~and/or~individual~and/or~software~making~the~claim.} |
| 2755 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{Seq} |
| 2756 |
\__pdfmeta_xmp_add_packet_close:nn{pdfaType}{field} |
| 2757 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{li} |
| 2758 |
\__pdfmeta_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"} |
| 2759 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{type}{declaration} |
| 2760 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{namespaceURI} |
| 2761 |
{http://pdfa.org/declarations/} |
| 2762 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{prefix}{pdfd} |
| 2763 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfaType}{description} |
| 2764 |
{A~structure~describing~a~single~PDF~ Declaration~asserting~conformance~with~ an~externally-identified~standard~or~ profile.} |
| 2765 |
\__pdfmeta_xmp_add_packet_open:nn{pdfaType}{field} |
| 2766 |
\__pdfmeta_xmp_add_packet_open:nn{rdf}{Seq} |
| 2767 |
\__pdfmeta_xmp_add_packet_field:nnn{conformsTo}{Text} |
| 2768 |
{A~property~containing~a~URI~specifying~the~standard~or~profile~by~the~PDF~Declaration.~This~property~is~ intended~to~mirror~the~Dublin~Core~property~dc:conformsTo.} |
| 2769 |
\__pdfmeta_xmp_add_packet_field:nnn{claimData}{Bag~claim} |
| 2770 |
{An~unordered~array~of~claim~data,~where~each~claim~identifies~the~nature~of~the~claim.} |
| 2771 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{Seq} |
| 2772 |
\__pdfmeta_xmp_add_packet_close:nn{pdfaType}{field} |
| 2773 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{li} |
| 2774 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{Seq} |
| 2775 |
\__pdfmeta_xmp_add_packet_close:nn{pdfaSchema}{valueType} |
| 2776 |
} |
| 2777 |
\cs_gset_eq:NN \__pdfmeta_xmp_schema_enable_pdfd: \prg_do_nothing: |
| 2778 |
} |
| 2779 |
|
| 2780 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_pdf: |
| 2781 |
{ |
| 2782 |
\__pdfmeta_xmp_add_packet_line_default:nnee |
| 2783 |
{pdf}{Producer} |
| 2784 |
{\c_sys_engine_exec_str-\c_sys_engine_version_str} |
| 2785 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfproducer}} |
| 2786 |
\__pdfmeta_xmp_add_packet_line:nne{pdf}{PDFVersion}{\pdf_version:} |
| 2787 |
} |
| 2788 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_xmp: |
| 2789 |
{ |
| 2790 |
\__pdfmeta_xmp_add_packet_line_default:nnee |
| 2791 |
{xmp}{CreatorTool} |
| 2792 |
{LaTeX} |
| 2793 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfcreator} } |
| 2794 |
\__pdfmeta_xmp_add_packet_line_default:nnee |
| 2795 |
{xmp}{BaseURL}{} |
| 2796 |
{ \pdfmanagement_get_documentproperty:n{hyperref/baseurl} } |
| 2797 |
\__pdfmeta_xmp_date_get:nNN |
| 2798 |
{document/creationdate}\l__pdfmeta_tmpa_tl\l__pdfmeta_tmpa_seq |
| 2799 |
\__pdfmeta_xmp_add_packet_line:nne{xmp}{CreateDate}{\__pdfmeta_xmp_print_date:N\l__pdfmeta_tmpa_seq} |
| 2800 |
\pdfmanagement_add:nne{Info}{CreationDate}{(\l__pdfmeta_tmpa_tl)} |
| 2801 |
\__pdfmeta_xmp_date_get:nNN |
| 2802 |
{document/moddate}\l__pdfmeta_tmpa_tl\l__pdfmeta_tmpa_seq |
| 2803 |
\__pdfmeta_xmp_add_packet_line:nne{xmp}{ModifyDate}{\__pdfmeta_xmp_print_date:N\l__pdfmeta_tmpa_seq} |
| 2804 |
\pdfmanagement_add:nne{Info}{ModDate}{(\l__pdfmeta_tmpa_tl)} |
| 2805 |
\__pdfmeta_xmp_date_get:nNN |
| 2806 |
{hyperref/pdfmetadate}\l__pdfmeta_tmpa_tl\l__pdfmeta_tmpa_seq |
| 2807 |
\__pdfmeta_xmp_add_packet_line:nne{xmp}{MetadataDate}{\__pdfmeta_xmp_print_date:N\l__pdfmeta_tmpa_seq} |
| 2808 |
} |
| 2809 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_standards: |
| 2810 |
{ |
| 2811 |
\__pdfmeta_xmp_add_packet_line:nne {pdfaid}{part}{\pdfmeta_standard_item:n{level}} |
| 2812 |
\__pdfmeta_xmp_add_packet_line:nne |
| 2813 |
{pdfaid}{conformance}{\pdfmeta_standard_item:n{conformance}} |
| 2814 |
\int_compare:nNnTF {0\pdfmeta_standard_item:n{level}}<{4} |
| 2815 |
{\__pdfmeta_xmp_add_packet_line:nne {pdfaid}{year} {\pdfmeta_standard_item:n{year}}} |
| 2816 |
{\__pdfmeta_xmp_add_packet_line:nne {pdfaid}{rev} {\pdfmeta_standard_item:n{year}}} |
| 2817 |
\__pdfmeta_xmp_add_packet_line:nne |
| 2818 |
{pdfxid}{GTS_PDFXVersion}{\pdfmanagement_get_documentproperty:n{document/pdfstandard-X}} |
| 2819 |
\pdfmanagement_get_documentproperty:nNT {document/pdfstandard-UA}\l__pdfmeta_tmpa_tl |
| 2820 |
{ |
| 2821 |
\__pdfmeta_xmp_add_packet_line:nne |
| 2822 |
{pdfuaid}{part}{\exp_last_unbraced:No\use_i:nn \l__pdfmeta_tmpa_tl} |
| 2823 |
\__pdfmeta_xmp_add_packet_line:nne |
| 2824 |
{pdfuaid}{rev}{\exp_last_unbraced:No\use_ii:nn \l__pdfmeta_tmpa_tl} |
| 2825 |
} |
| 2826 |
} |
| 2827 |
\prop_new:N \g__pdfmeta_xmp_pdfd_data_prop |
| 2828 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_pdfd: |
| 2829 |
{ |
| 2830 |
\prop_if_empty:NF\g__pdfmeta_xmp_pdfd_data_prop |
| 2831 |
{ |
| 2832 |
\__pdfmeta_xmp_add_packet_open:nn{pdfd}{declarations} |
| 2833 |
\__pdfmeta_xmp_add_packet_open:nn{rdf}{Bag} |
| 2834 |
\prop_map_inline:Nn \g__pdfmeta_xmp_pdfd_data_prop |
| 2835 |
{ |
| 2836 |
\__pdfmeta_xmp_build_pdfd_claim:nn{##1}{##2} |
| 2837 |
} |
| 2838 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{Bag} |
| 2839 |
\__pdfmeta_xmp_add_packet_close:nn{pdfd}{declarations} |
| 2840 |
} |
| 2841 |
} |
| 2842 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_pdfd_claim:nn #1#2 |
| 2843 |
{ |
| 2844 |
\__pdfmeta_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"} |
| 2845 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfd}{conformsTo}{#1} |
| 2846 |
\tl_if_empty:nF {#2} |
| 2847 |
{ |
| 2848 |
\__pdfmeta_xmp_add_packet_open:nn{pdfd}{claimData} |
| 2849 |
\__pdfmeta_xmp_add_packet_open:nn{rdf}{Bag} |
| 2850 |
#2 |
| 2851 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{Bag} |
| 2852 |
\__pdfmeta_xmp_add_packet_close:nn{pdfd}{claimData} |
| 2853 |
} |
| 2854 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{li} |
| 2855 |
} |
| 2856 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_photoshop: |
| 2857 |
{ |
| 2858 |
\__pdfmeta_xmp_add_packet_line:nne{photoshop}{AuthorsPosition} |
| 2859 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfauthortitle} } |
| 2860 |
\__pdfmeta_xmp_add_packet_line:nne{photoshop}{CaptionWriter} |
| 2861 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfcaptionwriter} } |
| 2862 |
} |
| 2863 |
|
| 2864 |
|
| 2865 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_xmpMM: |
| 2866 |
{ |
| 2867 |
\str_set:Ne\l__pdfmeta_tmpa_str {\pdfmanagement_get_documentproperty:n{hyperref/pdfdocumentid}} |
| 2868 |
\str_if_empty:NT \l__pdfmeta_tmpa_str |
| 2869 |
{ |
| 2870 |
\__pdfmeta_xmp_create_uuid:nN |
| 2871 |
{\jobname\pdfmanagement_get_documentproperty:n{hyperref/pdftitle}} |
| 2872 |
\l__pdfmeta_tmpa_str |
| 2873 |
} |
| 2874 |
\__pdfmeta_xmp_add_packet_line:nnV{xmpMM}{DocumentID} |
| 2875 |
\l__pdfmeta_tmpa_str |
| 2876 |
\str_set:Ne\l__pdfmeta_tmpa_str {\pdfmanagement_get_documentproperty:n{hyperref/pdfinstanceid}} |
| 2877 |
\str_if_empty:NT \l__pdfmeta_tmpa_str |
| 2878 |
{ |
| 2879 |
\__pdfmeta_xmp_create_uuid:nN |
| 2880 |
{\jobname\l__pdfmeta_xmp_currentdate_tl} |
| 2881 |
\l__pdfmeta_tmpa_str |
| 2882 |
} |
| 2883 |
\__pdfmeta_xmp_add_packet_line:nnV{xmpMM}{InstanceID} |
| 2884 |
\l__pdfmeta_tmpa_str |
| 2885 |
\__pdfmeta_xmp_add_packet_line:nne{xmpMM}{VersionID} |
| 2886 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfversionid} } |
| 2887 |
\__pdfmeta_xmp_add_packet_line:nne{xmpMM}{RenditionClass} |
| 2888 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfrendition} } |
| 2889 |
} |
| 2890 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_dc: |
| 2891 |
{ |
| 2892 |
\__pdfmeta_xmp_add_packet_list_simple:nnne {dc}{creator}{Seq} |
| 2893 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfauthor} } |
| 2894 |
\int_compare:nNnT {0\pdfmeta_standard_item:n{level}}={1} |
| 2895 |
{ \pdfmanagement_remove:nn{Info}{Author} } |
| 2896 |
\__pdfmeta_xmp_add_packet_list:nnne {dc}{title}{Alt} |
| 2897 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdftitle} } |
| 2898 |
\__pdfmeta_xmp_add_packet_list_simple:nnne {dc}{subject}{Bag} |
| 2899 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfkeywords} } |
| 2900 |
\int_compare:nNnT {0\pdfmeta_standard_item:n{level}}={1} |
| 2901 |
{ \pdfmanagement_remove:nn{Info}{Keywords} } |
| 2902 |
\pdfmanagement_get_documentproperty:nNTF { hyperref/pdftype } \l__pdfmeta_tmpa_tl |
| 2903 |
{ |
| 2904 |
\__pdfmeta_xmp_add_packet_list_simple:nnnV {dc}{type}{Bag}\l__pdfmeta_tmpa_tl |
| 2905 |
} |
| 2906 |
{ |
| 2907 |
\__pdfmeta_xmp_add_packet_list_simple:nnnn {dc}{type}{Bag}{Text} |
| 2908 |
} |
| 2909 |
\__pdfmeta_xmp_add_packet_list_simple:nnne {dc}{publisher}{Bag} |
| 2910 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfpublisher} } |
| 2911 |
\__pdfmeta_xmp_add_packet_list:nnne |
| 2912 |
{dc}{description}{Alt} |
| 2913 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfsubject}} |
| 2914 |
\__pdfmeta_xmp_add_packet_list_simple:nnnV |
| 2915 |
{dc}{language}{Bag}\l__pdfmeta_xmp_doclang_tl |
| 2916 |
\__pdfmeta_xmp_add_packet_line:nne{dc}{identifier} |
| 2917 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfidentifier} } |
| 2918 |
\__pdfmeta_xmp_date_get:nNN {hyperref/pdfdate}\l__pdfmeta_tmpa_tl\l__pdfmeta_tmpa_seq |
| 2919 |
\__pdfmeta_xmp_add_packet_list_simple:nnne |
| 2920 |
{dc}{date}{Seq}{\__pdfmeta_xmp_print_date:N\l__pdfmeta_tmpa_seq} |
| 2921 |
\__pdfmeta_xmp_add_packet_line:nnn{dc}{format}{application/pdf} |
| 2922 |
\__pdfmeta_xmp_add_packet_line_default:nnee |
| 2923 |
{dc}{source} |
| 2924 |
{ \c_sys_jobname_str.tex } |
| 2925 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdfsource} } |
| 2926 |
\__pdfmeta_xmp_add_packet_list:nnne{dc}{rights}{Alt} |
| 2927 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfcopyright}} |
| 2928 |
} |
| 2929 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_xmpRights: |
| 2930 |
{ |
| 2931 |
\__pdfmeta_xmp_add_packet_line:nne |
| 2932 |
{xmpRights} |
| 2933 |
{WebStatement} |
| 2934 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdflicenseurl}} |
| 2935 |
\__pdfmeta_xmp_add_packet_line:nne |
| 2936 |
{xmpRights} |
| 2937 |
{Marked} |
| 2938 |
{ |
| 2939 |
\str_case:en {\pdfmanagement_get_documentproperty:n{document/copyright}} |
| 2940 |
{ |
| 2941 |
{true}{True} |
| 2942 |
{false}{False} |
| 2943 |
} |
| 2944 |
} |
| 2945 |
} |
| 2946 |
\tl_new:N\l__pdfmeta_xmp_iptc_data_tl |
| 2947 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_iptc_data:N #1 |
| 2948 |
{ |
| 2949 |
\tl_clear:N #1 |
| 2950 |
\__pdfmeta_xmp_incr_indent:\__pdfmeta_xmp_incr_indent:\__pdfmeta_xmp_incr_indent:\__pdfmeta_xmp_incr_indent: |
| 2951 |
\__pdfmeta_xmp_add_packet_line:nneN |
| 2952 |
{Iptc4xmpCore}{CiAdrExtadr} |
| 2953 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfcontactaddress}} |
| 2954 |
#1 |
| 2955 |
\__pdfmeta_xmp_add_packet_line:nneN |
| 2956 |
{Iptc4xmpCore}{CiAdrCity} |
| 2957 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfcontactcity}} |
| 2958 |
#1 |
| 2959 |
\__pdfmeta_xmp_add_packet_line:nneN |
| 2960 |
{Iptc4xmpCore}{CiAdrPcode} |
| 2961 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfcontactpostcode}} |
| 2962 |
#1 |
| 2963 |
\__pdfmeta_xmp_add_packet_line:nneN |
| 2964 |
{Iptc4xmpCore}{CiAdrCtry} |
| 2965 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfcontactcountry}} |
| 2966 |
#1 |
| 2967 |
\__pdfmeta_xmp_add_packet_line:nneN |
| 2968 |
{Iptc4xmpCore}{CiTelWork} |
| 2969 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfcontactphone}} |
| 2970 |
#1 |
| 2971 |
\__pdfmeta_xmp_add_packet_line:nneN |
| 2972 |
{Iptc4xmpCore}{CiEmailWork} |
| 2973 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfcontactemail}} |
| 2974 |
#1 |
| 2975 |
\__pdfmeta_xmp_add_packet_line:nneN |
| 2976 |
{Iptc4xmpCore}{CiUrlWork} |
| 2977 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfcontacturl}} |
| 2978 |
#1 |
| 2979 |
\__pdfmeta_xmp_decr_indent:\__pdfmeta_xmp_decr_indent:\__pdfmeta_xmp_decr_indent:\__pdfmeta_xmp_decr_indent: |
| 2980 |
} |
| 2981 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_iptc: |
| 2982 |
{ |
| 2983 |
\tl_if_empty:NF\l__pdfmeta_xmp_iptc_data_tl |
| 2984 |
{ |
| 2985 |
\__pdfmeta_xmp_add_packet_open_attr:nnn |
| 2986 |
{Iptc4xmpCore}{CreatorContactInfo}{rdf:parseType="Resource"} |
| 2987 |
\tl_gput_right:Ne\g__pdfmeta_xmp_packet_tl { \l__pdfmeta_xmp_iptc_data_tl } |
| 2988 |
\__pdfmeta_xmp_add_packet_close:nn |
| 2989 |
{Iptc4xmpCore}{CreatorContactInfo} |
| 2990 |
} |
| 2991 |
} |
| 2992 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_prism: |
| 2993 |
{ |
| 2994 |
\__pdfmeta_xmp_add_packet_line:nnn |
| 2995 |
{prism}{complianceProfile} |
| 2996 |
{three} |
| 2997 |
\__pdfmeta_xmp_lang_get:eNN |
| 2998 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfsubtitle}} |
| 2999 |
\l__pdfmeta_tmpa_tl\l__pdfmeta_tmpb_tl |
| 3000 |
\__pdfmeta_xmp_add_packet_line_attr:nneV |
| 3001 |
{prism}{subtitle} |
| 3002 |
{xml:lang="\l__pdfmeta_tmpa_tl"} |
| 3003 |
\l__pdfmeta_tmpb_tl |
| 3004 |
\__pdfmeta_xmp_lang_get:eNN |
| 3005 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfpublication}} |
| 3006 |
\l__pdfmeta_tmpa_tl\l__pdfmeta_tmpb_tl |
| 3007 |
\__pdfmeta_xmp_add_packet_line_attr:nneV |
| 3008 |
{prism}{publicationName} |
| 3009 |
{xml:lang="\l__pdfmeta_tmpa_tl"} |
| 3010 |
\l__pdfmeta_tmpb_tl |
| 3011 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3012 |
{prism}{bookEdition} |
| 3013 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfbookedition}} |
| 3014 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3015 |
{prism}{aggregationType} |
| 3016 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfpubtype}} |
| 3017 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3018 |
{prism}{volume} |
| 3019 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfvolumenum}} |
| 3020 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3021 |
{prism}{number} |
| 3022 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfissuenum}} |
| 3023 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3024 |
{prism}{pageRange} |
| 3025 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfpagerange}} |
| 3026 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3027 |
{prism}{issn} |
| 3028 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfissn}} |
| 3029 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3030 |
{prism}{eIssn} |
| 3031 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfeissn}} |
| 3032 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3033 |
{prism}{doi} |
| 3034 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfdoi}} |
| 3035 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3036 |
{prism}{url} |
| 3037 |
{\pdfmanagement_get_documentproperty:n{hyperref/pdfurl}} |
| 3038 |
\tl_set:Ne \l__pdfmeta_tmpa_tl { \pdfmanagement_get_documentproperty:n{hyperref/pdfnumpages} } |
| 3039 |
\__pdfmeta_xmp_add_packet_line:nne |
| 3040 |
{prism}{pageCount} |
| 3041 |
{\tl_if_blank:VTF \l__pdfmeta_tmpa_tl {\PreviousTotalPages}{\l__pdfmeta_tmpa_tl}} |
| 3042 |
} |
| 3043 |
|
| 3044 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_tdm: |
| 3045 |
{ |
| 3046 |
\__pdfmeta_xmp_add_packet_line:nne{tdm}{reservation} |
| 3047 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdftdmreservation} } |
| 3048 |
\__pdfmeta_xmp_add_packet_line:nne{tdm}{policy} |
| 3049 |
{ \pdfmanagement_get_documentproperty:n{hyperref/pdftdmpolicy} } |
| 3050 |
} |
| 3051 |
\tl_new:N \g__pdfmeta_xmp_user_packet_tl |
| 3052 |
\cs_new_protected:Npn \__pdfmeta_xmp_build_user: |
| 3053 |
{ |
| 3054 |
\int_zero:N \l__pdfmeta_xmp_indent_int |
| 3055 |
\g__pdfmeta_xmp_user_packet_tl |
| 3056 |
\int_set:Nn \l__pdfmeta_xmp_indent_int {3} |
| 3057 |
} |
| 3058 |
\hook_new:n { pdfmeta/xmp } |
| 3059 |
\AddToHook{shipout/lastpage}[pdfmanagement-testphase] |
| 3060 |
{ |
| 3061 |
\bool_if:NT\g__pdfmeta_xmp_bool |
| 3062 |
{ |
| 3063 |
\str_if_exist:NTF\c_sys_timestamp_str |
| 3064 |
{ |
| 3065 |
\tl_set_eq:NN \l__pdfmeta_xmp_currentdate_tl \c_sys_timestamp_str |
| 3066 |
} |
| 3067 |
{ |
| 3068 |
\file_get_timestamp:nN{\jobname.log}\l__pdfmeta_xmp_currentdate_tl |
| 3069 |
} |
| 3070 |
\__pdfmeta_xmp_date_split:VN\l__pdfmeta_xmp_currentdate_tl\l__pdfmeta_xmp_currentdate_seq |
| 3071 |
\hook_use:n { pdfmeta/xmp } |
| 3072 |
\__pdfmeta_xmp_build_packet: |
| 3073 |
\pdf_object_new:n {__pdfmeta/xmp} |
| 3074 |
\exp_args:No |
| 3075 |
\__pdf_backend_metadata_stream:n {\g__pdfmeta_xmp_packet_tl} |
| 3076 |
\pdfmanagement_add:nne {Catalog} {Metadata}{\pdf_object_ref:n{__pdfmeta/xmp}} |
| 3077 |
\bool_if:NT \g__pdfmeta_xmp_export_bool |
| 3078 |
{ |
| 3079 |
\iow_open:Nn\g_tmpa_iow{\g__pdfmeta_xmp_export_str.xmpi} |
| 3080 |
\exp_args:NNo\iow_now:Nn\g_tmpa_iow{\g__pdfmeta_xmp_packet_tl} |
| 3081 |
\iow_close:N\g_tmpa_iow |
| 3082 |
} |
| 3083 |
} |
| 3084 |
} |
| 3085 |
|
| 3086 |
|
| 3087 |
\cs_new_protected:Npn \pdfmeta_xmp_add:n #1 |
| 3088 |
{ |
| 3089 |
\tl_gput_right:Nn \g__pdfmeta_xmp_user_packet_tl |
| 3090 |
{ |
| 3091 |
\__pdfmeta_xmp_add_packet_chunk:n { #1 } |
| 3092 |
} |
| 3093 |
} |
| 3094 |
\cs_new_protected:Npn \pdfmeta_xmp_xmlns_new:nn #1 #2 |
| 3095 |
{ |
| 3096 |
\prop_if_in:NnTF \g__pdfmeta_xmp_xmlns_prop {#1} |
| 3097 |
{\msg_warning:nnnn{pdfmeta}{xmp-defined}{xmlns~namespace}{#1}} |
| 3098 |
{\__pdfmeta_xmp_xmlns_new:nn {#1}{#2}} |
| 3099 |
} |
| 3100 |
\cs_set_eq:NN \pdfmeta_xmp_schema_new:nnn \__pdfmeta_xmp_schema_new:nnn |
| 3101 |
\cs_set_eq:NN \pdfmeta_xmp_property_new:nnnnn \__pdfmeta_xmp_property_new:nnnnn |
| 3102 |
\cs_new_protected:Npn \pdfmeta_xmp_add_declaration:n #1 %conformsTo uri |
| 3103 |
{ |
| 3104 |
\__pdfmeta_xmp_schema_enable_pdfd: |
| 3105 |
\prop_gput:Nnn\g__pdfmeta_xmp_pdfd_data_prop{#1}{} |
| 3106 |
} |
| 3107 |
\cs_generate_variant:Nn \pdfmeta_xmp_add_declaration:n {e} |
| 3108 |
\cs_new_protected:Npn \pdfmeta_xmp_add_declaration:nnnnn #1#2#3#4#5 |
| 3109 |
%#1=conformsTo uri, #2 claimBy, #3 claimDate #4 claimCredentials #4 claimReport |
| 3110 |
{ |
| 3111 |
\__pdfmeta_xmp_schema_enable_pdfd: |
| 3112 |
\tl_set:Nn \l__pdfmeta_tmpa_tl |
| 3113 |
{ |
| 3114 |
\__pdfmeta_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"} |
| 3115 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfd}{claimBy}{#2} |
| 3116 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfd}{claimDate}{#3} |
| 3117 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfd}{claimCredentials}{#4} |
| 3118 |
\__pdfmeta_xmp_add_packet_line:nnn{pdfd}{claimReport}{#5} |
| 3119 |
\__pdfmeta_xmp_add_packet_close:nn{rdf}{li} |
| 3120 |
} |
| 3121 |
\prop_get:NnNT \g__pdfmeta_xmp_pdfd_data_prop {#1}\l__pdfmeta_tmpb_tl |
| 3122 |
{ |
| 3123 |
\tl_concat:NNN \l__pdfmeta_tmpa_tl \l__pdfmeta_tmpa_tl \l__pdfmeta_tmpb_tl |
| 3124 |
} |
| 3125 |
\prop_gput:Nno\g__pdfmeta_xmp_pdfd_data_prop{#1} |
| 3126 |
{ |
| 3127 |
\l__pdfmeta_tmpa_tl |
| 3128 |
} |
| 3129 |
} |
| 3130 |
\cs_generate_variant:Nn\pdfmeta_xmp_add_declaration:nnnnn {e,eee} |
| 3131 |
|
| 3132 |
\cs_new:Npn \__pdfmeta_xmp_iso_today: |
| 3133 |
{ |
| 3134 |
\int_use:N\c_sys_year_int- |
| 3135 |
\int_compare:nNnT {\c_sys_month_int} < {10}{0} \int_use:N\c_sys_month_int - |
| 3136 |
\int_compare:nNnT {\c_sys_day_int} < {10}{0} \int_use:N\c_sys_day_int |
| 3137 |
} |
| 3138 |
\cs_new_protected:Npn \__pdfmeta_xmp_wtpdf_reuse_declaration: |
| 3139 |
{ |
| 3140 |
\pdfmeta_xmp_add_declaration:eeenn |
| 3141 |
{http://pdfa.org/declarations/wtpdf\c_hash_str reuse1.0} |
| 3142 |
{LaTeX~Project} |
| 3143 |
{\__pdfmeta_xmp_iso_today:}{}{} |
| 3144 |
} |
| 3145 |
\cs_new_protected:Npn \__pdfmeta_xmp_wtpdf_accessibility_declaration: |
| 3146 |
{ |
| 3147 |
\pdfmeta_xmp_add_declaration:ennnn |
| 3148 |
{http://pdfa.org/declarations/wtpdf\c_hash_str accessibility1.0} |
| 3149 |
{LaTeX~Project} |
| 3150 |
{\__pdfmeta_xmp_iso_today:}{}{} |
| 3151 |
} |
| 3152 |
%% File: l3pdftools.dtx |
| 3153 |
\cs_generate_variant:Nn \str_convert_pdfname:n { e } |
| 3154 |
|
| 3155 |
\cs_new:Npn \pdf_name_from_unicode_e:n #1 |
| 3156 |
{ |
| 3157 |
\__kernel_pdf_name_from_unicode_e:n { #1 } |
| 3158 |
} |
| 3159 |
|
| 3160 |
\cs_generate_variant:Nn \pdf_name_from_unicode_e:n {V} |
| 3161 |
\bool_lazy_any:nTF |
| 3162 |
{ |
| 3163 |
\sys_if_engine_luatex_p: |
| 3164 |
\sys_if_engine_xetex_p: |
| 3165 |
} |
| 3166 |
{ |
| 3167 |
\prop_gput:Nnn \g__str_alias_prop { default } { } |
| 3168 |
} |
| 3169 |
{ |
| 3170 |
\prop_gput:Nnn \g__str_alias_prop { default } { utf8 } |
| 3171 |
} |
| 3172 |
\msg_new:nnn {pdfmanagement}{ unknown-convert} |
| 3173 |
{ |
| 3174 |
Unknown~string~conversion~method~'#1'! |
| 3175 |
} |
| 3176 |
\cs_new:Npn \pdf_string_from_unicode:nnN #1 #2 #3 |
| 3177 |
{ |
| 3178 |
\cs_if_exist_use:cF { __pdf_string_from_unicode_#1:nN } |
| 3179 |
{ |
| 3180 |
\msg_error:nnn { pdf } { unknown-convert } {#1} |
| 3181 |
\use_none:nn |
| 3182 |
} |
| 3183 |
{ #2 } #3 |
| 3184 |
} |
| 3185 |
|
| 3186 |
\cs_generate_variant:Nn \pdf_string_from_unicode:nnN {nVN} |
| 3187 |
%% TODO Names need a review when it is clear which converters |
| 3188 |
%% are actually needed |
| 3189 |
%% string conversions and printing |
| 3190 |
%% we assume here that the text purify step has been done. The input is |
| 3191 |
%% a list of (utf8) chars. |
| 3192 |
%% str convert, not expandable. |
| 3193 |
|
| 3194 |
|
| 3195 |
\cs_new_protected:cpn { __pdf_string_from_unicode_utf8/string-raw:nN } #1 #2 |
| 3196 |
{ |
| 3197 |
\str_set_convert:Nnnn #2 |
| 3198 |
{ #1 } |
| 3199 |
{ default } |
| 3200 |
{utf8/string} |
| 3201 |
} |
| 3202 |
|
| 3203 |
\cs_new_protected:cpn { __pdf_string_from_unicode_utf8/string:nN } #1 #2 |
| 3204 |
{ |
| 3205 |
\use:c { __pdf_string_from_unicode_utf8/string-raw:nN } { #1 } #2 |
| 3206 |
\str_put_left:Nn #2 {(} |
| 3207 |
\str_put_right:Nn #2 {)} |
| 3208 |
} |
| 3209 |
\cs_new_protected:cpx { __pdf_string_from_unicode_utf8/URI-raw:nN } #1 #2 |
| 3210 |
{ |
| 3211 |
\exp_not:N \str_set_convert:Nnnn #2 |
| 3212 |
{ #1 } |
| 3213 |
{ default } |
| 3214 |
{utf8/url} |
| 3215 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 3A} {:} |
| 3216 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 2F} {/} |
| 3217 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 23} {\c_hash_str} |
| 3218 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 5B} {[} |
| 3219 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 5D} {]} |
| 3220 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 40} {\c_atsign_str} |
| 3221 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 21} {!} |
| 3222 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 24} {\c_dollar_str} |
| 3223 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 26} {\c_ampersand_str} |
| 3224 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 27} {'} |
| 3225 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 2A} {*} |
| 3226 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 2B} {+} |
| 3227 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 2C} {,} |
| 3228 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 3B} {;} |
| 3229 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 3D} {=} |
| 3230 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 3F} {?} |
| 3231 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 30} {0} |
| 3232 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 31} {1} |
| 3233 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 32} {2} |
| 3234 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 33} {3} |
| 3235 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 34} {4} |
| 3236 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 35} {5} |
| 3237 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 36} {6} |
| 3238 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 37} {7} |
| 3239 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 38} {8} |
| 3240 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 39} {9} |
| 3241 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 28} {\c_backslash_str(} |
| 3242 |
\exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 29} {\c_backslash_str)} |
| 3243 |
} |
| 3244 |
|
| 3245 |
\cs_new_protected:cpn { __pdf_string_from_unicode_utf8/URI:nN } #1 #2 |
| 3246 |
{ |
| 3247 |
\use:c { __pdf_string_from_unicode_utf8/URI-raw:nN } {#1} #2 |
| 3248 |
\str_put_left:Nn #2 {(} |
| 3249 |
\str_put_right:Nn #2 {)} |
| 3250 |
} |
| 3251 |
\cs_new_protected:cpn { __pdf_string_from_unicode_utf16/string-raw:nN } #1 #2 |
| 3252 |
{ |
| 3253 |
\str_set_convert:Nnnn #2 |
| 3254 |
{ #1 } |
| 3255 |
{ default } |
| 3256 |
{utf16/string} |
| 3257 |
} |
| 3258 |
|
| 3259 |
\cs_new_protected:cpn { __pdf_string_from_unicode_utf16/string:nN } #1 #2 |
| 3260 |
{ |
| 3261 |
\use:c { __pdf_string_from_unicode_utf16/string-raw:nN } {#1} #2 |
| 3262 |
\str_put_left:Nn #2 {(} |
| 3263 |
\str_put_right:Nn #2 {)} |
| 3264 |
} |
| 3265 |
|
| 3266 |
\cs_new_protected:cpn { __pdf_string_from_unicode_utf16/hex-raw:nN } #1 #2 |
| 3267 |
{ |
| 3268 |
\str_set_convert:Nnnn #2 |
| 3269 |
{ #1 } |
| 3270 |
{ default } |
| 3271 |
{utf16/hex} |
| 3272 |
} |
| 3273 |
|
| 3274 |
\cs_new_protected:cpn { __pdf_string_from_unicode_utf16/hex:nN } #1 #2 |
| 3275 |
{ |
| 3276 |
\use:c { __pdf_string_from_unicode_utf16/hex-raw:nN } {#1} #2 |
| 3277 |
\str_put_left:Nn #2 {<} |
| 3278 |
\str_put_right:Nn #2 {>} |
| 3279 |
} |
| 3280 |
|
| 3281 |
\newif\ifHy@pdfstring |
| 3282 |
\def\texorpdfstring{% |
| 3283 |
\ifHy@pdfstring |
| 3284 |
\expandafter\@secondoftwo |
| 3285 |
\else |
| 3286 |
\expandafter\@firstoftwo |
| 3287 |
\fi |
| 3288 |
} |
| 3289 |
\tl_new:N\l__pdf_purify_tmpa_tl |
| 3290 |
\str_new:N\g__pdf_purify_tmpa_str |
| 3291 |
\socket_new:nn{pdf/purify/setup}{0} |
| 3292 |
\socket_new_plug:nnn { pdf/purify/setup } { kernel} |
| 3293 |
{ |
| 3294 |
\__pdf_purify_equivalents: |
| 3295 |
\hook_use:n {pdf/purify/setup} |
| 3296 |
} |
| 3297 |
\socket_assign_plug:nn { pdf/purify/setup } { kernel} |
| 3298 |
\hook_new:n{pdf/purify/setup} |
| 3299 |
\providecommand\pdfstringdefPreHook{} |
| 3300 |
\hook_gput_code:nnn{pdf/purify/setup}{pdf}{\pdfstringdefPreHook} |
| 3301 |
\socket_new:nn {pdf/purify} {2} |
| 3302 |
\socket_new_plug:nnn {pdf/purify} {kernel} |
| 3303 |
{ |
| 3304 |
\str_set:Ne #2 {\text_purify:n { #1 } } |
| 3305 |
} |
| 3306 |
\socket_assign_plug:nn{pdf/purify}{kernel} |
| 3307 |
\hook_new_with_args:nn {pdf/purify/after}{1} |
| 3308 |
\cs_new_protected:Npn \__pdf_purify:nN #1 #2 %#1 content #2 str-var |
| 3309 |
{ |
| 3310 |
\group_begin: |
| 3311 |
\socket_use:n {pdf/purify/setup} |
| 3312 |
\socket_use:nnn {pdf/purify} {#1} {#2} |
| 3313 |
\hook_use:nnw {pdf/purify/after} {1} {#2} |
| 3314 |
\str_gset_eq:NN \g__pdf_purify_tmpa_str #2 |
| 3315 |
\group_end: |
| 3316 |
\str_set_eq:NN #2 \g__pdf_purify_tmpa_str |
| 3317 |
} |
| 3318 |
\cs_set_eq:NN \pdf_purify:nN\__pdf_purify:nN |
| 3319 |
\cs_new_protected:Npn \__pdf_purify_equivalents: |
| 3320 |
{ |
| 3321 |
\Hy@pdfstringtrue |
| 3322 |
\text_declare_expand_equivalent:Nn\MakeUppercase{\__pdf_purify_makeuppercase:n} |
| 3323 |
\text_declare_expand_equivalent:Nn\MakeLowercase{\__pdf_purify_makelowercase:n} |
| 3324 |
\cs_set:Npn\dots{…} %U+2026 |
| 3325 |
\cs_set:Npn\ldots{…} |
| 3326 |
\cs_set:Npn\P{¶} |
| 3327 |
\cs_set:Npn\TeX{TeX} |
| 3328 |
\cs_set:Npn\LaTeX{LaTeX} |
| 3329 |
\cs_set:Npn\LaTeXe{LaTeX2ε} |
| 3330 |
\cs_set:Npn\SliTeX{Sli\TeX}% |
| 3331 |
\cs_set:Npn\MF{Metafont}% |
| 3332 |
\cs_set:Npn\MP{Metapost}% |
| 3333 |
\cs_set_eq:NN\phantom\use_none:n |
| 3334 |
\cs_set_eq:NN\vphantom\use_none:n |
| 3335 |
\cs_set_eq:NN\hphantom\use_none:n |
| 3336 |
\cs_set_eq:NN\mathversion\use_none:n |
| 3337 |
% \ding ? |
| 3338 |
% \Cube ? |
| 3339 |
% \begin ? |
| 3340 |
% \end ? |
| 3341 |
\cs_set_eq:NN\emph\use_i:n |
| 3342 |
\cs_set_eq:NN\em\prg_do_nothing: |
| 3343 |
\cs_set_eq:NN\textnormal\use_i:n |
| 3344 |
\cs_set_eq:NN\textrm\use_i:n |
| 3345 |
\cs_set_eq:NN\textsf\use_i:n |
| 3346 |
\cs_set_eq:NN\texttt\use_i:n |
| 3347 |
\cs_set_eq:NN\textbf\use_i:n |
| 3348 |
\cs_set_eq:NN\textmd\use_i:n |
| 3349 |
\cs_set_eq:NN\textit\use_i:n |
| 3350 |
\cs_set_eq:NN\textsc\use_i:n |
| 3351 |
\cs_set_eq:NN\textsl\use_i:n |
| 3352 |
\cs_set_eq:NN\textup\use_i:n |
| 3353 |
\cs_set_eq:NN\normalfont\prg_do_nothing: |
| 3354 |
\cs_set_eq:NN\rmfamily\prg_do_nothing: |
| 3355 |
\cs_set_eq:NN\sffamily\prg_do_nothing: |
| 3356 |
\cs_set_eq:NN\ttfamily\prg_do_nothing: |
| 3357 |
\cs_set_eq:NN\bfseries\prg_do_nothing: |
| 3358 |
\cs_set_eq:NN\mdseries\prg_do_nothing: |
| 3359 |
\cs_set_eq:NN\itshape\prg_do_nothing: |
| 3360 |
\cs_set_eq:NN\scshape\prg_do_nothing: |
| 3361 |
\cs_set_eq:NN\slshape\prg_do_nothing: |
| 3362 |
\cs_set_eq:NN\upshape\prg_do_nothing: |
| 3363 |
\cs_set_eq:NN\Huge\prg_do_nothing: |
| 3364 |
\cs_set_eq:NN\LARGE\prg_do_nothing: |
| 3365 |
\cs_set_eq:NN\Large\prg_do_nothing: |
| 3366 |
\cs_set_eq:NN\footnotesize\prg_do_nothing: |
| 3367 |
\cs_set_eq:NN\huge\prg_do_nothing: |
| 3368 |
\cs_set_eq:NN\large\prg_do_nothing: |
| 3369 |
\cs_set_eq:NN\normalsize\prg_do_nothing: |
| 3370 |
\cs_set_eq:NN\scriptsize\prg_do_nothing: |
| 3371 |
\cs_set_eq:NN\small\prg_do_nothing: |
| 3372 |
\cs_set_eq:NN\tiny\prg_do_nothing: |
| 3373 |
\cs_set_eq:NN\quad\space |
| 3374 |
\cs_set_eq:NN\qquad\space |
| 3375 |
\cs_set_eq:NN\hspace\__pdf_purify_hspace:w |
| 3376 |
\cs_set_eq:NN\textcolor\use_ii:nn |
| 3377 |
\cs_set_eq:NN\color \@gobble@om |
| 3378 |
\cs_set_eq:NN\label \@gobble@om |
| 3379 |
\cs_set_eq:NN\index \@gobble@som |
| 3380 |
\cs_set_eq:NN\glossary \@gobble@om |
| 3381 |
\cs_set_eq:NN\ref\__pdf_purify_ref:w |
| 3382 |
\cs_set_eq:NN\pageref\__pdf_purify_pageref:w |
| 3383 |
\cs_set_eq:NN\nameref\__pdf_purify_nameref:w |
| 3384 |
\cs_set_eq:NN\autoref\HyPsd@autoref |
| 3385 |
\let\@mkboth\@gobbletwo |
| 3386 |
% what to do with all the \textxxx commands? |
| 3387 |
\text_declare_expand_equivalent:Nn\textparagraph{¶} |
| 3388 |
\text_declare_expand_equivalent:Nn\textdollar{\$} |
| 3389 |
} |
| 3390 |
\cs_new:Npn\__pdf_purify_nameref:n #1 |
| 3391 |
{\cs_if_exist:cTF {r@#1}{\tl_item:cn{r@#1}{3}}{0}} |
| 3392 |
\DeclareExpandableDocumentCommand\__pdf_purify_ref:w{sm}{\@kernel@ref@exp{#2}} |
| 3393 |
\DeclareExpandableDocumentCommand\__pdf_purify_pageref:w{sm}{\@kernel@pageref@exp{#2}} |
| 3394 |
\DeclareExpandableDocumentCommand\__pdf_purify_nameref:w{sm}{\__pdf_purify_nameref:n{#2}} |
| 3395 |
\cs_new:Npn \__pdf_purify_makeuppercase:n #1 |
| 3396 |
{\use:e |
| 3397 |
{\exp_args:Ne |
| 3398 |
\text_uppercase:nn{\BCPdata { casing }}{#1} |
| 3399 |
} |
| 3400 |
} |
| 3401 |
\cs_new:Npn \__pdf_purify_makelowercase:n #1 |
| 3402 |
{\use:e |
| 3403 |
{\exp_args:Ne |
| 3404 |
\text_lowercase:nn{\BCPdata { casing }}{#1} |
| 3405 |
} |
| 3406 |
} |
| 3407 |
\NewExpandableDocumentCommand\__pdf_purify_hspace:w{sm} |
| 3408 |
{ |
| 3409 |
\dim_compare:nNnT{#2}>{0pt}{\space} |
| 3410 |
} |
| 3411 |
\cs_new_protected:Npn \pdf_bdc:nn #1 #2 { \__pdf_backend_bdc:nn { #1 }{ #2 } } |
| 3412 |
\cs_generate_variant:Nn \pdf_bdc:nn {ee} |
| 3413 |
|
| 3414 |
\cs_new_protected:Npn \pdf_bdc_property:nn #1 #2 |
| 3415 |
{ \__pdf_backend_bdc_contobj:nn { #1 }{ #2 } } |
| 3416 |
\cs_new_protected:Npn \pdf_bdc_shipout:ee #1 #2 |
| 3417 |
{ |
| 3418 |
\__pdf_backend_bdc_shipout:ee { #1 }{ #2 } |
| 3419 |
\cs_gset_eq:NN \pdf_bdc_shipout:ee \__pdf_backend_bdc_shipout:ee |
| 3420 |
} |
| 3421 |
\cs_new_protected:Npn \pdf_bdcobject:nn #1 #2 { \__pdf_backend_bdcobject:nn { #1 }{ #2 } } |
| 3422 |
\cs_new_protected:Npn \pdf_bdcobject:n #1 { \__pdf_backend_bdcobject:n { #1 } } |
| 3423 |
\cs_new_protected:Npn \pdf_bmc:n #1 { \__pdf_backend_bmc:n { #1 } } |
| 3424 |
\cs_new_protected:Npn \pdf_emc: { \__pdf_backend_emc: } |
| 3425 |
%% File: l3pdffile.dtx |
| 3426 |
|
| 3427 |
\cs_new_protected:Npn \__pdffile_filename_convert_to_print:nN #1 #2 |
| 3428 |
{\pdf_string_from_unicode:nnN {utf16/hex}{#1}{#2}} |
| 3429 |
\msg_new:nnn { pdffile } { file-not-found } |
| 3430 |
{ |
| 3431 |
File~'\tl_to_str:n{#1}'~not~found |
| 3432 |
} |
| 3433 |
|
| 3434 |
\msg_new:nnn { pdffile } { mimetype-missing } |
| 3435 |
{ |
| 3436 |
Mime~type~not~set~for~file~'\tl_to_str:n{#1}' |
| 3437 |
} |
| 3438 |
|
| 3439 |
\msg_new:nnn { pdffile } { target-name-missing } |
| 3440 |
{ |
| 3441 |
a~target~name~for~the~/Filespec~dictionary~is~missing. |
| 3442 |
} |
| 3443 |
|
| 3444 |
\msg_new:nnn { pdffile } { object-exists } |
| 3445 |
{ |
| 3446 |
object~name~'#1'~is~already~used. |
| 3447 |
} |
| 3448 |
|
| 3449 |
\msg_new:nnn { pdffile } { show-files } |
| 3450 |
{ |
| 3451 |
The~following~files~have~been~embedded\\ |
| 3452 |
#1 |
| 3453 |
} |
| 3454 |
\tl_new:N \l__pdffile_tmpa_tl |
| 3455 |
\tl_new:N \l__pdffile_tmpb_tl |
| 3456 |
\tl_new:N \g__pdffile_tmpa_tl |
| 3457 |
\str_new:N \l__pdffile_tmpa_str |
| 3458 |
\str_new:N \l__pdffile_tmpb_str |
| 3459 |
\str_new:N \l__pdffile_ext_str |
| 3460 |
\tl_new:N \l__pdffile_automimetype_tl |
| 3461 |
\tl_new:N \l__pdffile_embed_ref_tl |
| 3462 |
\prop_new:N \g_pdffile_mimetypes_prop |
| 3463 |
\prop_gset_from_keyval:Nn \g_pdffile_mimetypes_prop |
| 3464 |
{ |
| 3465 |
,.css = text/css |
| 3466 |
,.csv = text/csv |
| 3467 |
,.html= text/html |
| 3468 |
,.dtx = text/plain %or application/x-tex, not in iana.org list |
| 3469 |
,.eps = application/postscript |
| 3470 |
,.jpg = image/jpeg |
| 3471 |
,.mp4 = video/mp4 |
| 3472 |
,.pdf = application/pdf |
| 3473 |
,.png = image/png |
| 3474 |
,.tex = application/x-tex %not in iana.org list but probably better |
| 3475 |
,.txt = text/plain |
| 3476 |
,.sty = text/plain |
| 3477 |
,.xml = application/xml |
| 3478 |
} |
| 3479 |
\int_new:N\g_pdffile_embed_pdfa_int |
| 3480 |
\int_new:N\g_pdffile_embed_nonpdfa_int |
| 3481 |
\str_new:N \l_pdffile_source_name_str |
| 3482 |
\pdfdict_new:n { l_pdffile } |
| 3483 |
\pdfdict_put:nnn { l_pdffile }{Type}{/EmbeddedFile} |
| 3484 |
\pdfdict_new:n { l_pdffile/Params } |
| 3485 |
\pdfdict_put:nnn { l_pdffile/Params } |
| 3486 |
{ModDate} { (\file_timestamp:n { \l_pdffile_source_name_str }) } |
| 3487 |
\pdfdict_put:nnn { l_pdffile/Params } |
| 3488 |
{Size} { \file_size:n { \l_pdffile_source_name_str } } |
| 3489 |
\pdfdict_put:nnn { l_pdffile/Params } |
| 3490 |
{CheckSum} { <\file_mdfive_hash:n { \l_pdffile_source_name_str }> } |
| 3491 |
\pdfdict_new:n { l_pdffile/streamParams } |
| 3492 |
\pdfdict_put:nnn { l_pdffile/streamParams } |
| 3493 |
{ModDate} { |
| 3494 |
( |
| 3495 |
D:\int_use:N\c_sys_year_int |
| 3496 |
\int_compare:nNnT{\c_sys_month_int}<{10}{0} |
| 3497 |
\int_use:N\c_sys_month_int |
| 3498 |
\int_compare:nNnT{\c_sys_day_int}<{10}{0} |
| 3499 |
\int_use:N\c_sys_day_int |
| 3500 |
) |
| 3501 |
} |
| 3502 |
\pdfdict_new:n { l_pdffile/Filespec } |
| 3503 |
\pdfdict_put:nnn { l_pdffile/Filespec } |
| 3504 |
{Type} { /Filespec } |
| 3505 |
\pdfdict_put:nnn { l_pdffile/Filespec } |
| 3506 |
{AFRelationship} { /Unspecified } |
| 3507 |
|
| 3508 |
\prop_new_linked:N \g_pdffile_embed_prop |
| 3509 |
\bool_new:N \l_pdffile_embed_show_bool |
| 3510 |
\cs_new_protected:Npn \pdffile_embed_show: |
| 3511 |
{ |
| 3512 |
\msg_show:nne |
| 3513 |
{pdffile}{show-files} |
| 3514 |
{ |
| 3515 |
\prop_map_function:NN {\g_pdffile_embed_prop} \msg_show_item:nn |
| 3516 |
} |
| 3517 |
} |
| 3518 |
\cs_new_protected:Npn \__pdffile_mimetype_set:nNN #1 #2 #3 |
| 3519 |
{ |
| 3520 |
\file_parse_full_name:nNNN |
| 3521 |
{#1} |
| 3522 |
\l__pdffile_tmpa_str %unused |
| 3523 |
\l__pdffile_tmpb_str %unused |
| 3524 |
\l__pdffile_ext_str |
| 3525 |
%check if Subtype has been set |
| 3526 |
\pdfdict_get:nnN { l_pdffile}{Subtype}\l__pdffile_tmpa_tl |
| 3527 |
%if not look up in the prop: |
| 3528 |
\quark_if_no_value:NT \l__pdffile_tmpa_tl |
| 3529 |
{ |
| 3530 |
\prop_get:NVNTF |
| 3531 |
\g_pdffile_mimetypes_prop |
| 3532 |
\l__pdffile_ext_str |
| 3533 |
\l__pdffile_tmpb_tl |
| 3534 |
{ |
| 3535 |
\tl_set:Ne #2 {/Subtype~\pdf_name_from_unicode_e:V \l__pdffile_tmpb_tl} |
| 3536 |
} |
| 3537 |
{ |
| 3538 |
\msg_warning:nne { pdffile }{ mimetype-missing} {#1} |
| 3539 |
\tl_clear:N #2 |
| 3540 |
} |
| 3541 |
} |
| 3542 |
\tl_set_eq:NN #3 \l__pdffile_ext_str |
| 3543 |
} |
| 3544 |
|
| 3545 |
\cs_generate_variant:Nn \__pdffile_mimetype_set:nNN {VNN} |
| 3546 |
|
| 3547 |
\cs_new_protected:Npn \__pdffile_count_embed:N #1 |
| 3548 |
{ |
| 3549 |
\str_if_eq:VnTF #1 {.pdf} |
| 3550 |
{\int_gincr:N \g_pdffile_embed_pdfa_int } |
| 3551 |
{\int_gincr:N \g_pdffile_embed_nonpdfa_int } |
| 3552 |
} |
| 3553 |
|
| 3554 |
\cs_new_protected:Npn \__pdffile_fstream_write:nN #1 #2 |
| 3555 |
{ |
| 3556 |
\pdf_object_unnamed_write:ne { fstream } |
| 3557 |
{ |
| 3558 |
{ |
| 3559 |
#2 |
| 3560 |
\pdfdict_use:n { l_pdffile} |
| 3561 |
\pdfdict_if_empty:nF { l_pdffile/Params} |
| 3562 |
{ |
| 3563 |
/Params |
| 3564 |
<< |
| 3565 |
\pdfdict_use:n { l_pdffile/Params} |
| 3566 |
>> |
| 3567 |
} |
| 3568 |
} |
| 3569 |
{ #1 } |
| 3570 |
} |
| 3571 |
\tl_clear:N \l__pdffile_automimetype_tl |
| 3572 |
} |
| 3573 |
|
| 3574 |
\cs_generate_variant:Nn \__pdffile_fstream_write:nN {VN} |
| 3575 |
|
| 3576 |
\cs_new_protected:Npn \__pdffile_stream_write:nN #1 #2 |
| 3577 |
{ |
| 3578 |
\pdf_object_unnamed_write:ne { stream } |
| 3579 |
{ |
| 3580 |
{ |
| 3581 |
#2 |
| 3582 |
\pdfdict_use:n { l_pdffile} |
| 3583 |
\pdfdict_if_empty:nF { l_pdffile/streamParams} |
| 3584 |
{ |
| 3585 |
/Params |
| 3586 |
<< |
| 3587 |
\pdfdict_use:n { l_pdffile/streamParams} |
| 3588 |
>> |
| 3589 |
} |
| 3590 |
} |
| 3591 |
{ \exp_not:n { #1 } } |
| 3592 |
} |
| 3593 |
\tl_clear:N \l__pdffile_automimetype_tl |
| 3594 |
} |
| 3595 |
|
| 3596 |
\cs_generate_variant:Nn \__pdffile_stream_write:nN {VN} |
| 3597 |
|
| 3598 |
\cs_new_protected:Npn \__pdffile_filespec_write:nnn #1 #2 #3 |
| 3599 |
{ |
| 3600 |
\tl_if_blank:nTF { #2 } |
| 3601 |
{ |
| 3602 |
\msg_error:nn {pdffile}{target-name-missing} |
| 3603 |
} |
| 3604 |
{ |
| 3605 |
\group_begin: |
| 3606 |
\pdf_string_from_unicode:nnN {utf8/string}{#2}\l__pdffile_tmpa_str |
| 3607 |
\pdfdict_put:nne {l_pdffile/Filespec}{F} { \l__pdffile_tmpa_str } |
| 3608 |
\__pdffile_filename_convert_to_print:nN { #2 } \l__pdffile_tmpa_str |
| 3609 |
\pdfdict_put:nne {l_pdffile/Filespec}{UF}{ \l__pdffile_tmpa_str } |
| 3610 |
\pdf_object_write:nne { #1 } { dict } |
| 3611 |
{ |
| 3612 |
\pdfdict_use:n { l_pdffile/Filespec} |
| 3613 |
\tl_if_empty:nF { #3 } |
| 3614 |
{ |
| 3615 |
/EF <</F~#3 /UF~#3>> |
| 3616 |
} |
| 3617 |
} |
| 3618 |
\group_end: |
| 3619 |
} |
| 3620 |
} |
| 3621 |
|
| 3622 |
\cs_new_protected:Npn \__pdffile_filespec_write:nnN #1 #2 #3 |
| 3623 |
{ |
| 3624 |
\tl_if_blank:nTF { #1 } |
| 3625 |
{ |
| 3626 |
\msg_error:nn {pdffile}{target-name-missing} |
| 3627 |
} |
| 3628 |
{ |
| 3629 |
\group_begin: |
| 3630 |
\pdf_string_from_unicode:nnN {utf8/string}{#1}\l__pdffile_tmpa_str |
| 3631 |
\pdfdict_put:nne {l_pdffile/Filespec}{F} { \l__pdffile_tmpa_str } |
| 3632 |
\__pdffile_filename_convert_to_print:nN { #1 } \l__pdffile_tmpa_str |
| 3633 |
\pdfdict_put:nne {l_pdffile/Filespec}{UF}{ \l__pdffile_tmpa_str } |
| 3634 |
\pdf_object_unnamed_write:ne {dict} |
| 3635 |
{ |
| 3636 |
\pdfdict_use:n { l_pdffile/Filespec} |
| 3637 |
\tl_if_empty:nF { #2 } |
| 3638 |
{ |
| 3639 |
/EF <</F~#2 /UF~#2>> |
| 3640 |
} |
| 3641 |
} |
| 3642 |
\tl_gset:Ne\g__pdffile_tmpa_tl{\pdf_object_ref_last:} |
| 3643 |
\group_end: |
| 3644 |
\tl_set_eq:NN#3\g__pdffile_tmpa_tl |
| 3645 |
} |
| 3646 |
} |
| 3647 |
|
| 3648 |
\cs_set_eq:NN \pdffile_filespec:nnn \__pdffile_filespec_write:nnn |
| 3649 |
\cs_generate_variant:Nn \pdffile_filespec:nnn {nne,nnx} |
| 3650 |
\cs_new_protected:Npn \pdffile_embed_file:nnn #1 #2 #3 |
| 3651 |
{ % if #1 empty => only filespec |
| 3652 |
% if #2 empty => = #1 |
| 3653 |
\pdf_object_if_exist:nTF { #3 } |
| 3654 |
{ |
| 3655 |
\msg_error:nnn { pdffile }{ object-exists } { #3 } |
| 3656 |
} |
| 3657 |
{ |
| 3658 |
\tl_if_blank:nTF { #1 } |
| 3659 |
{ |
| 3660 |
\tl_set:Nn \l__pdffile_embed_ref_tl {} |
| 3661 |
} |
| 3662 |
{ |
| 3663 |
\file_get_full_name:nNTF {#1} \l_pdffile_source_name_str |
| 3664 |
{ |
| 3665 |
\__pdffile_mimetype_set:VNN |
| 3666 |
\l_pdffile_source_name_str |
| 3667 |
\l__pdffile_automimetype_tl |
| 3668 |
\l__pdffile_tmpa_tl |
| 3669 |
\__pdffile_count_embed:N \l__pdffile_tmpa_tl |
| 3670 |
\__pdffile_fstream_write:VN |
| 3671 |
\l_pdffile_source_name_str |
| 3672 |
\l__pdffile_automimetype_tl |
| 3673 |
\tl_set:Ne \l__pdffile_embed_ref_tl { \pdf_object_ref_last: } |
| 3674 |
} |
| 3675 |
{ |
| 3676 |
\msg_error:nnn { pdffile }{ file-not-found }{ #1 } |
| 3677 |
} |
| 3678 |
|
| 3679 |
} |
| 3680 |
\bool_if:NT\l_pdffile_embed_show_bool |
| 3681 |
{ |
| 3682 |
\prop_gput:Nne |
| 3683 |
\g_pdffile_embed_prop |
| 3684 |
{ #3 } |
| 3685 |
{ |
| 3686 |
{ \tl_if_blank:nTF { #1 } {filespec}{file} } |
| 3687 |
{\l_pdffile_source_name_str} |
| 3688 |
{ |
| 3689 |
\tl_if_blank:nTF { #2 } |
| 3690 |
{ \l_pdffile_source_name_str } |
| 3691 |
{ \tl_to_str:n{#2}} |
| 3692 |
} |
| 3693 |
} |
| 3694 |
} |
| 3695 |
\tl_if_blank:nTF { #2 } |
| 3696 |
{ |
| 3697 |
\pdf_object_new:n { #3 } |
| 3698 |
\exp_args:Nnne |
| 3699 |
\__pdffile_filespec_write:nnn |
| 3700 |
%#1 dict, #2 target file name, #3 object ref |
| 3701 |
{ #3 } |
| 3702 |
{ #1 } |
| 3703 |
{\l__pdffile_embed_ref_tl} |
| 3704 |
} |
| 3705 |
{ |
| 3706 |
\pdf_object_new:n { #3 } |
| 3707 |
\exp_args:Nnne |
| 3708 |
\__pdffile_filespec_write:nnn |
| 3709 |
%#1 dict, #2 target file name, #3 object ref |
| 3710 |
{ #3 } |
| 3711 |
{ #2 } |
| 3712 |
{\l__pdffile_embed_ref_tl} |
| 3713 |
} |
| 3714 |
} |
| 3715 |
} |
| 3716 |
|
| 3717 |
\cs_new_protected:Npn \pdffile_embed_stream:nnn #1 #2 #3 |
| 3718 |
{ |
| 3719 |
% if #2 empty => error |
| 3720 |
\pdf_object_if_exist:nTF { #3 } |
| 3721 |
{ |
| 3722 |
\msg_error:nnn { pdffile }{ object-exists } { #3 } |
| 3723 |
} |
| 3724 |
{ |
| 3725 |
\bool_if:NT\l_pdffile_embed_show_bool |
| 3726 |
{ |
| 3727 |
\prop_gput:Nne |
| 3728 |
\g_pdffile_embed_prop |
| 3729 |
{ #3 } |
| 3730 |
{{stream}{}{\tl_if_blank:nTF {#2}{stream.txt}{\exp_not:n{#2}}}} |
| 3731 |
} |
| 3732 |
\tl_if_blank:nTF {#2} |
| 3733 |
{ \__pdffile_mimetype_set:nNN {stream.txt}\l__pdffile_automimetype_tl \l__pdffile_tmpa_tl} |
| 3734 |
{ \__pdffile_mimetype_set:nNN { #2 } \l__pdffile_automimetype_tl \l__pdffile_tmpa_tl } |
| 3735 |
\__pdffile_count_embed:N \l__pdffile_tmpa_tl |
| 3736 |
\__pdffile_stream_write:nN |
| 3737 |
{ #1 } |
| 3738 |
\l__pdffile_automimetype_tl |
| 3739 |
\tl_set:Ne \l__pdffile_embed_ref_tl { \pdf_object_ref_last: } |
| 3740 |
\pdf_object_new:n { #3 } |
| 3741 |
\exp_args:Nnee |
| 3742 |
\__pdffile_filespec_write:nnn |
| 3743 |
%#1 dict, #2 target file name, #3 object ref |
| 3744 |
{ #3 } |
| 3745 |
{ \tl_if_blank:nTF {#2}{stream.txt}{\exp_not:n{#2}} } |
| 3746 |
{\l__pdffile_embed_ref_tl} |
| 3747 |
} |
| 3748 |
} |
| 3749 |
|
| 3750 |
\cs_new_protected:Npn \pdffile_embed_stream:nnN #1 #2 #3 |
| 3751 |
{ |
| 3752 |
\tl_if_blank:nTF {#2} |
| 3753 |
{ \__pdffile_mimetype_set:nNN {stream.txt}\l__pdffile_automimetype_tl \l__pdffile_tmpa_tl} |
| 3754 |
{ \__pdffile_mimetype_set:nNN { #2 } \l__pdffile_automimetype_tl \l__pdffile_tmpa_tl } |
| 3755 |
\__pdffile_count_embed:N\l__pdffile_tmpa_tl |
| 3756 |
\__pdffile_stream_write:nN |
| 3757 |
{ #1 } |
| 3758 |
\l__pdffile_automimetype_tl |
| 3759 |
\tl_set:Ne \l__pdffile_embed_ref_tl { \pdf_object_ref_last: } |
| 3760 |
\exp_args:Nee |
| 3761 |
\__pdffile_filespec_write:nnN |
| 3762 |
%#1 target file name, #2 object ref of stream, #3 object ref of filespec |
| 3763 |
{ \tl_if_blank:nTF {#2}{stream.txt}{\exp_not:n{#2}} } |
| 3764 |
{\l__pdffile_embed_ref_tl} |
| 3765 |
#3 |
| 3766 |
\bool_if:NT \l_pdffile_embed_show_bool |
| 3767 |
{ |
| 3768 |
\prop_gput:Nee |
| 3769 |
\g_pdffile_embed_prop |
| 3770 |
{ #3 } |
| 3771 |
{{stream}{}{\tl_if_blank:nTF {#2}{stream.txt}{\exp_not:n{#2}}}} |
| 3772 |
} |
| 3773 |
} |
| 3774 |
|
| 3775 |
%% File: l3pdfoutline.dtx |
| 3776 |
\bool_new:N \l_pdfoutline_active_bool |
| 3777 |
\bool_set_true:N \l_pdfoutline_active_bool |
| 3778 |
\bool_new:N \l_pdfoutline_open_bool |
| 3779 |
\bool_set_true:N \l_pdfoutline_open_bool |
| 3780 |
\int_new:N \l_pdfoutline_open_int |
| 3781 |
\int_set:Nn \l_pdfoutline_open_int { \c_max_int } |
| 3782 |
\bitset_new:Nn \l_pdfoutline_F_bitset |
| 3783 |
{ |
| 3784 |
Italic = 1, |
| 3785 |
italic = 1, |
| 3786 |
Bold = 2, |
| 3787 |
bold = 2 |
| 3788 |
} |
| 3789 |
\tl_new:N \l_pdfoutline_color_tl |
| 3790 |
\tl_new:N \l_pdfoutline_color_model_tl |
| 3791 |
\tl_set:Nn \l_pdfoutline_color_model_tl {rgb} |
| 3792 |
\tl_new:N\l__pdfoutline_tmpa_tl |
| 3793 |
|
| 3794 |
\int_new:N \g__pdfoutline_id_int |
| 3795 |
\int_gincr:N \g__pdfoutline_id_int |
| 3796 |
\tl_new:N \g__pdfoutline_current_parent_id_tl |
| 3797 |
\tl_gset:Nn \g__pdfoutline_current_parent_id_tl {1} |
| 3798 |
\int_new:N \g__pdfoutline_current_level_int |
| 3799 |
\int_gincr:N \g__pdfoutline_current_level_int |
| 3800 |
\int_const:Nn \c__pdfoutline_block_size_int { 2000 } |
| 3801 |
\intarray_new:Nn \g__pdfoutline_kid_count_intarray { \c__pdfoutline_block_size_int } |
| 3802 |
\intarray_new:Nn \g__pdfoutline_parent_id_intarray { \c__pdfoutline_block_size_int } |
| 3803 |
\intarray_gset:Nnn \g__pdfoutline_parent_id_intarray {1}{1} |
| 3804 |
\tl_new:N \g__pdfoutline_collect_build_tl |
| 3805 |
\cs_new_protected:Npn \pdfoutline_action:nnn #1 #2 #3 |
| 3806 |
{ |
| 3807 |
\bool_if:NT \l_pdfoutline_active_bool |
| 3808 |
{ |
| 3809 |
\int_compare:nNnTF {\g__pdfoutline_id_int}={1} |
| 3810 |
{ |
| 3811 |
\tl_build_gbegin:N \g__pdfoutline_collect_build_tl |
| 3812 |
\__pdfoutline_item:nnnn {0}{#2}{#3}{action} |
| 3813 |
\tl_gput_right:Nn \g__kernel_pdfmanagement_end_run_code_tl |
| 3814 |
{ |
| 3815 |
\tl_build_gend:N \g__pdfoutline_collect_build_tl |
| 3816 |
\tl_use:N \g__pdfoutline_collect_build_tl |
| 3817 |
} |
| 3818 |
} |
| 3819 |
{ |
| 3820 |
\__pdfoutline_item:nnnn {#1}{#2}{#3}{action} |
| 3821 |
} |
| 3822 |
\cs_gset_protected:Npn \pdfoutline_action:nnn ##1 ##2 ##3 |
| 3823 |
{ |
| 3824 |
\bool_if:NT \l_pdfoutline_active_bool |
| 3825 |
{\__pdfoutline_item:nnnn {##1}{##2}{##3}{action}} |
| 3826 |
} |
| 3827 |
} |
| 3828 |
} |
| 3829 |
\cs_generate_variant:Nn \pdfoutline_action:nnn {nee} |
| 3830 |
\cs_new_protected:Npn \pdfoutline_goto:nnn #1 #2 #3 |
| 3831 |
{ |
| 3832 |
\bool_if:NT \l_pdfoutline_active_bool |
| 3833 |
{ |
| 3834 |
\int_compare:nNnTF {\g__pdfoutline_id_int}={1} |
| 3835 |
{ |
| 3836 |
\tl_build_gbegin:N \g__pdfoutline_collect_build_tl |
| 3837 |
\__pdfoutline_item:nnnn {0}{#2}{#3}{goto} |
| 3838 |
\tl_gput_right:Nn \g__kernel_pdfmanagement_end_run_code_tl |
| 3839 |
{ |
| 3840 |
\tl_build_gend:N \g__pdfoutline_collect_build_tl |
| 3841 |
\tl_use:N \g__pdfoutline_collect_build_tl |
| 3842 |
} |
| 3843 |
} |
| 3844 |
{ |
| 3845 |
\__pdfoutline_item:nnnn {#1}{#2}{#3}{goto} |
| 3846 |
} |
| 3847 |
\cs_gset_protected:Npn \pdfoutline_goto:nnn ##1 ##2 ##3 |
| 3848 |
{ |
| 3849 |
\bool_if:NT \l_pdfoutline_active_bool |
| 3850 |
{\__pdfoutline_item:nnnn {##1}{##2}{##3}{goto}} |
| 3851 |
} |
| 3852 |
} |
| 3853 |
} |
| 3854 |
\cs_generate_variant:Nn \pdfoutline_goto:nnn {nee} |
| 3855 |
\cs_new_protected:Npn \__pdfoutline_item:nnnn #1 #2 #3 #4 |
| 3856 |
{ |
| 3857 |
\int_gincr:N \g__pdfoutline_id_int |
| 3858 |
\int_compare:nNnTF {#1}={0} |
| 3859 |
{ |
| 3860 |
\intarray_gset:Nnn |
| 3861 |
\g__pdfoutline_parent_id_intarray |
| 3862 |
{ \g__pdfoutline_id_int } |
| 3863 |
{ \g__pdfoutline_current_parent_id_tl } |
| 3864 |
\intarray_gset:Nnn |
| 3865 |
\g__pdfoutline_kid_count_intarray |
| 3866 |
{ \g__pdfoutline_current_parent_id_tl } |
| 3867 |
{ \intarray_item:Nn \g__pdfoutline_kid_count_intarray { \g__pdfoutline_current_parent_id_tl } + 1 } |
| 3868 |
} |
| 3869 |
{ |
| 3870 |
\int_compare:nNnTF {#1} > {0} |
| 3871 |
{ |
| 3872 |
\int_gincr:N \g__pdfoutline_current_level_int |
| 3873 |
\tl_gset:Ne \g__pdfoutline_current_parent_id_tl |
| 3874 |
{ \int_eval:n { \g__pdfoutline_id_int -1 } } |
| 3875 |
\intarray_gset:Nnn |
| 3876 |
\g__pdfoutline_parent_id_intarray |
| 3877 |
{ \g__pdfoutline_id_int } |
| 3878 |
{ \g__pdfoutline_current_parent_id_tl } |
| 3879 |
\intarray_gset:Nnn |
| 3880 |
\g__pdfoutline_kid_count_intarray |
| 3881 |
{ \g__pdfoutline_current_parent_id_tl } |
| 3882 |
{ 1 } |
| 3883 |
} |
| 3884 |
{ |
| 3885 |
\int_compare:nNnTF { \g__pdfoutline_current_level_int } = {1} |
| 3886 |
{ |
| 3887 |
\tl_gset:Ne \g__pdfoutline_current_parent_id_tl {1} |
| 3888 |
} |
| 3889 |
{ |
| 3890 |
\int_step_inline:nn |
| 3891 |
{ \int_min:nn { \int_abs:n {#1} } { \g__pdfoutline_current_level_int -1 } } |
| 3892 |
{ |
| 3893 |
\tl_gset:Ne \g__pdfoutline_current_parent_id_tl |
| 3894 |
{ \intarray_item:Nn \g__pdfoutline_parent_id_intarray { \g__pdfoutline_current_parent_id_tl } } |
| 3895 |
\int_gdecr:N \g__pdfoutline_current_level_int |
| 3896 |
} |
| 3897 |
} |
| 3898 |
\intarray_gset:Nnn |
| 3899 |
\g__pdfoutline_parent_id_intarray |
| 3900 |
{ \g__pdfoutline_id_int } |
| 3901 |
{ \g__pdfoutline_current_parent_id_tl } |
| 3902 |
\intarray_gset:Nnn |
| 3903 |
\g__pdfoutline_kid_count_intarray |
| 3904 |
{ \g__pdfoutline_current_parent_id_tl } |
| 3905 |
{ |
| 3906 |
\intarray_item:Nn |
| 3907 |
\g__pdfoutline_kid_count_intarray |
| 3908 |
{ \g__pdfoutline_current_parent_id_tl } + 1 |
| 3909 |
} |
| 3910 |
} |
| 3911 |
} |
| 3912 |
\__pdfoutline_store:nnn {#2}{#3}{#4} |
| 3913 |
} |
| 3914 |
\cs_new_protected:Npn \__pdfoutline_color_export_aux:wnnN [#1] #2 #3 #4 |
| 3915 |
{ |
| 3916 |
\color_export:nnnN {#1}{#2}{ space-sep-#3 }#4 |
| 3917 |
} |
| 3918 |
\cs_new_protected:Npn \__pdfoutline_color_export:nnN #1 #2 #3 %#1 color, #2 target model, #3 command |
| 3919 |
{ |
| 3920 |
\tl_if_blank:nTF { #1 } |
| 3921 |
{ \tl_clear:N #3 } |
| 3922 |
{ |
| 3923 |
\tl_if_head_eq_charcode:nNTF {#1} [ %] |
| 3924 |
{ |
| 3925 |
\__pdfoutline_color_export_aux:wnnN #1 { #2 } #3 |
| 3926 |
} |
| 3927 |
{ |
| 3928 |
\color_export:nnN { #1 } { space-sep-#2 } #3 |
| 3929 |
} |
| 3930 |
} |
| 3931 |
} |
| 3932 |
\cs_generate_variant:Nn \__pdfoutline_color_export:nnN {ee} |
| 3933 |
\cs_new_protected:Npn \__pdfoutline_store:nnn #1 #2 #3 |
| 3934 |
{ |
| 3935 |
\int_compare:nNnF { \g__pdfoutline_current_level_int } < { \l_pdfoutline_open_int } |
| 3936 |
{ \bool_set_false:N \l_pdfoutline_open_bool } |
| 3937 |
\__pdfoutline_color_export:eeN {\l_pdfoutline_color_tl}{\l_pdfoutline_color_model_tl}\l__pdfoutline_tmpa_tl |
| 3938 |
\tl_build_gput_right:Ne \g__pdfoutline_collect_build_tl |
| 3939 |
{ |
| 3940 |
\exp_not:N \use:c { __pdf_backend_#3:nnnnnnn } |
| 3941 |
% #1 level, #2 kid count, #3 open? #4 color, #5 flag, #6 action/destination, #7 title, |
| 3942 |
{ |
| 3943 |
\int_use:N \g__pdfoutline_current_level_int |
| 3944 |
} |
| 3945 |
{ |
| 3946 |
\exp_not:N \intarray_item:Nn |
| 3947 |
\exp_not:N \g__pdfoutline_kid_count_intarray |
| 3948 |
{ \int_use:N \g__pdfoutline_id_int } |
| 3949 |
} |
| 3950 |
{ |
| 3951 |
\bool_if:NTF\l_pdfoutline_open_bool {\exp_not:N \c_true_bool }{ \exp_not:N \c_false_bool} |
| 3952 |
} |
| 3953 |
{ |
| 3954 |
\l__pdfoutline_tmpa_tl |
| 3955 |
} |
| 3956 |
{ |
| 3957 |
\bitset_to_arabic:N \l_pdfoutline_F_bitset |
| 3958 |
} |
| 3959 |
{ |
| 3960 |
\exp_not:n {#1} % action/destination, or expand?? |
| 3961 |
} |
| 3962 |
{ |
| 3963 |
\exp_not:n {#2} % title, or expand?? |
| 3964 |
} |
| 3965 |
} |
| 3966 |
} |
| 3967 |
\cs_new:Npn \pdfoutline_id_ref_last: {\int_use:N\g__pdfoutline_id_int} |
| 3968 |
\cs_new:Npn \pdfoutline_level_ref_last: {\int_use:N\g__pdfoutline_current_level_int} |
| 3969 |
\cs_new:Npn \pdfoutline_parent_ref:n #1 { \intarray_item:Nn\g__pdfoutline_parent_id_intarray{#1} } |
| 3970 |
%% |
| 3971 |
%% |
| 3972 |
%% End of file `pdfmanagement.ltx'. |