summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def75
1 files changed, 74 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
index be271f63788..0435270fb92 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
@@ -20,7 +20,7 @@
%%
%% File: l3drivers.dtx Copyright(C) 2011-2018 The LaTeX3 Project
\ProvidesExplFile
- {l3pdfmode.def}{2018-08-23}{}
+ {l3pdfmode.def}{2018-09-24}{}
{L3 Experimental driver: PDF mode}
\cs_new_eq:NN \__driver_literal:e \tex_special:D
\cs_new_protected:Npn \__driver_literal:n #1
@@ -264,6 +264,79 @@
}
\cs_new_eq:NN \__driver_image_include_pdf:n \__driver_image_include_jpg:n
\cs_new_eq:NN \__driver_image_include_png:n \__driver_image_include_jpg:n
+\prop_new:N \g__driver_pdf_object_prop
+\group_begin:
+ \cs_set_protected:Npn \__driver_tmp:w #1#2
+ {
+ \cs_new_protected:Npx \driver_pdf_object_new:nn ##1##2
+ {
+ #1 reserveobjnum ~
+ \int_const:cn
+ { g__driver_pdf_object_ \exp_not:N \tl_to_str:n {##1} _int }
+ {#2}
+ \prop_gput:Nnn \exp_not:N \g__driver_pdf_object_prop {##1} {##2}
+ }
+ }
+ \cs_if_exist:NTF \tex_pdfextension:D
+ {
+ \__driver_tmp:w
+ { \tex_pdfextension:D obj ~ }
+ { \tex_pdffeedback:D lastobj \scan_stop: }
+ }
+ { \__driver_tmp:w { \tex_pdfobj:D } { \tex_pdflastobj:D } }
+\group_end:
+\cs_new:Npn \driver_pdf_object_ref:n #1
+ { \int_use:c { g__driver_pdf_object_ \tl_to_str:n {#1} _int } ~ 0 ~ R }
+\group_begin:
+ \cs_set_protected:Npn \__driver_tmp:w #1
+ {
+ \cs_new_protected:Npn \driver_pdf_object_write:nn ##1##2
+ {
+ \tex_immediate:D #1 useobjnum ~
+ \int_use:c
+ { g__driver_pdf_object_ \tl_to_str:n {##1} _int }
+ \str_case_e:nn
+ { \prop_item:Nn \g__driver_pdf_object_prop {##1} }
+ {
+ { array } { { [ ~ \exp_not:n {##2} ~ ] } }
+ { dict } { { << ~ \exp_not:n {##2} ~ >> } }
+ { fstream }
+ {
+ stream ~ attr ~ { \__driver_exp_not_i:nn ##2 } ~
+ file ~ { \__driver_exp_not_ii:nn ##2 }
+ }
+ { stream }
+ {
+ stream ~ attr ~ { \__driver_exp_not_i:nn ##2 } ~
+ { \__driver_exp_not_ii:nn ##2 }
+ }
+ }
+ }
+ }
+ \cs_if_exist:NTF \tex_pdfextension:D
+ { \__driver_tmp:w { \tex_pdfextension:D obj ~ } }
+ { \__driver_tmp:w { \tex_pdfobj:D } }
+\group_end:
+\cs_new:Npn \__driver_exp_not_i:nn #1#2 { \exp_not:n {#1} }
+\cs_new:Npn \__driver_exp_not_ii:nn #1#2 { \exp_not:n {#2} }
+\cs_new_protected:Npx \driver_pdf_compresslevel:n #1
+ {
+ \cs_if_exist:NTF \tex_pdfcompresslevel:D
+ { \tex_pdfcompresslevel:D }
+ { \tex_pdfvariable:D compresslevel }
+ \exp_not:N \int_value:w \exp_not:N \int_eval:n {#1} \scan_stop:
+ }
+\cs_new_protected:Npn \driver_pdf_objects_enable:
+ { \__driver_pdf_objectlevel:n { 2 } }
+\cs_new_protected:Npn \driver_pdf_objects_disable:
+ { \__driver_pdf_objectlevel:n { 0 } }
+\cs_new_protected:Npx \__driver_pdf_objectlevel:n #1
+ {
+ \cs_if_exist:NTF \tex_pdfobjcompresslevel:D
+ { \tex_pdfobjcompresslevel:D }
+ { \tex_pdfvariable:D objcompresslevel }
+ #1 \scan_stop:
+ }
\cs_new_eq:NN \__driver_draw_literal:n \__driver_literal_pdf:n
\cs_generate_variant:Nn \__driver_draw_literal:n { x }
\cs_new_protected:Npn \driver_draw_begin: