summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx')
-rw-r--r--macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx116
1 files changed, 35 insertions, 81 deletions
diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx
index 7b4aad8fe6..0102b1c574 100644
--- a/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx
+++ b/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx
@@ -45,7 +45,7 @@
% }^^A
% }
%
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
%
% \maketitle
%
@@ -56,27 +56,27 @@
% \begin{macrocode}
%<drivers>\ProvidesExplFile
%<*dvipdfmx>
- {l3backend-testphase-dvipdfmx.def}{2021-07-21}{}
+ {l3backend-testphase-dvipdfmx.def}{2021-07-31}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx}
%</dvipdfmx>
%<*dvips>
- {l3backend-testphase-dvips.def}{2021-07-21}{}
+ {l3backend-testphase-dvips.def}{2021-07-31}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: dvips}
%</dvips>
%<*dvisvgm>
- {l3backend-testphase-dvisvgm.def}{2021-07-21}{}
+ {l3backend-testphase-dvisvgm.def}{2021-07-31}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm}
%</dvisvgm>
%<*luatex>
- {l3backend-testphase-luatex.def}{2021-07-21}{}
+ {l3backend-testphase-luatex.def}{2021-07-31}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)}
%</luatex>
%<*pdftex>
- {l3backend-testphase-pdftex.def}{2021-07-21}{}
+ {l3backend-testphase-pdftex.def}{2021-07-31}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)}
%</pdftex>
%<*xdvipdfmx>
- {l3backend-testphase-xetex.def}{2021-07-21}{}
+ {l3backend-testphase-xetex.def}{2021-07-31}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX}
%</xdvipdfmx>
% \end{macrocode}
@@ -1086,116 +1086,70 @@
% \subsubsection { Special case: the /Names/EmbeddedFiles dictionary }
% Entries to /Names are handled differently, in part (/Desc) it is automatic, for
% other special commands like \cs{pdfnames} must be used. For EmbeddedFiles
-% we need some code to push the tree if files have been added. dvips wants code
-% for every file and then creates the Name tree automatically.
+% dvips wants code for every file and then creates the Name tree automatically.
+% Other name trees are ignored.
+% TODO: Currently the code for EmbeddedFiles is still a bit
+% different but this should be merged, all name trees should be handled with the
+% same code.
% \begin{macrocode}
% pdflatex
%<*pdftex>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
{
- \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
- \tex_pdfnames:D {/EmbeddedFiles~\pdf_object_ref_last:}
+ \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+ \tex_pdfnames:D {/#1~\pdf_object_ref_last:}
}
%</pdftex>
%<*luatex>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
{
- \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
- \tex_pdfextension:D~names~{/EmbeddedFiles~\pdf_object_ref_last: }
+ \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+ \tex_pdfextension:D~names~ {/#1~\pdf_object_ref_last:}
}
%</luatex>
%<*dvipdfmx|xdvipdfmx>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
{
- \pdf_object_unnamed_write:nn {dict} { /Names [#1] }
- %n or x?
- \@@_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_ref_last: >>}
+ \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+ \@@_backend:x {put~@names~<</#1~\pdf_object_ref_last: >>}
}
%</dvipdfmx|xdvipdfmx>
%dvips: noop
%<*dvips>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 {}
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2 {}
%</dvips>
%dvisvgm: noop
%<*dvisvgm>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 {}
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2 {}
%</dvisvgm>
-
-% \end{macrocode}
-% Names in the EmbeddedFiles name tree must sorted alphabetically,
-% so we need commands to create this names. And we need a sequence to store
-% the names and the objects. We use the prefix l3ef, and we assume that at
-% most 9999 files will be used.
-% \begin{variable}{\g_@@_backend_EmbeddedFiles_int}
-% \end{variable}
-% \begin{macro}{\@@_backend_EmbeddedFiles_name:}
-% \begin{macrocode}
-%<*drivers>
-\int_new:N \g_@@_backend_EmbeddedFiles_int
-\cs_new:Npn \@@_backend_EmbeddedFiles_name:
- {
- (
- l3ef
- \int_compare:nNnT {\g_@@_backend_EmbeddedFiles_int} < {10}
- {0}
- \int_compare:nNnT {\g_@@_backend_EmbeddedFiles_int} < {100}
- {0}
- \int_compare:nNnT {\g_@@_backend_EmbeddedFiles_int} < {1000}
- {0}
- \int_use:N \g_@@_backend_EmbeddedFiles_int
- )
- }
-%</drivers>
-% \end{macrocode}
-% \end{macro}
-% \begin{variable}{\g_@@_backend_EmbeddedFiles_seq,\g_@@_backend_EmbeddedFiles_named_prop}
-% The sequence will hold the content of the array that is pushed out at then
-% end (not with dvips), the prop holds the obj names-names relation.
-% \end{variable}
-% \begin{macrocode}
-%<*drivers>
-\seq_new:N \g_@@_backend_EmbeddedFiles_seq
-\prop_new:N \g_@@_backend_EmbeddedFiles_named_prop
-%</drivers>
% \end{macrocode}
-% \begin{macro}{\@@_backend_NamesEmbeddedFiles_add:n}
-% This command saves an object reference of a filespec dictionary in the
-% EmbeddedFiles name tree. We define a prop to store the relation between
-% object name and name in the name tree.
+% EmbeddedFiles is a bit special.
+% For once we need backend commands for dvips.
+% But we want also an option to create the name on the fly.
+% \begin{macro}{\@@_backend_NamesEmbeddedFiles_add:nn}
+% dvips need special backend code to create the name tree.
+% With the other engines it does nothing.
% \begin{macrocode}
%<*pdftex|luatex|dvipdfmx|xdvipdfmx>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_add:n #1
- %#1 object ref
- {
- \int_gincr:N \g_@@_backend_EmbeddedFiles_int
- \prop_gput:Nnx \g_@@_backend_EmbeddedFiles_named_prop
- { #1 }
- { \@@_backend_EmbeddedFiles_name: }
- \seq_gput_right:Nx \g_@@_backend_EmbeddedFiles_seq
- { \@@_backend_EmbeddedFiles_name: \c_space_tl #1 }
- }
-
+\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_add:nn #1 #2 {}
%</pdftex|luatex|dvipdfmx|xdvipdfmx>
%<*dvips>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_add:n #1
+\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_add:nn #1 #2
{
- \int_gincr:N \g_@@_backend_EmbeddedFiles_int
- \prop_gput:Nnx \g_@@_backend_EmbeddedFiles_named_prop
- { #1 }
- { \@@_backend_EmbeddedFiles_name: }
\@@_backend_pdfmark:x
{
- /Name~\@@_backend_EmbeddedFiles_name:~
- /FS~#1~
+ /Name~#1~
+ /FS~#2~
/EMBED
}
}
%</dvips>
%<*dvisvgm>
%no op. Or is there any sensible use for it?
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_add:n #1
+\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_add:nn #1 #2
{}
+
%</dvisvgm>
% \end{macrocode}
% \end{macro}