diff --git a/tagpdf-backend.dtx b/tagpdf-backend.dtx index 35beb89f..feb08304 100644 --- a/tagpdf-backend.dtx +++ b/tagpdf-backend.dtx @@ -706,7 +706,13 @@ end % The return value is |n 0 R|, if the object doesn't exist, n is 0. % \begin{macrocode} local function @@_pdf_object_ref (name,index) - local object = ltx.pdf.object_id (name,index) ..' 0 R' + local object + if ltx.pdf.object_id then + object = ltx.pdf.object_id (name,index) ..' 0 R' + else + local tokenname = 'c__pdf_object_'..name..'/'..index..'_int' + object = token.create(tokenname).mode ..' 0 R' + end return object end ltx.@@.func.pdf_object_ref = @@_pdf_object_ref diff --git a/tagpdf.dtx b/tagpdf.dtx index 043028a6..295c7072 100644 --- a/tagpdf.dtx +++ b/tagpdf.dtx @@ -184,7 +184,34 @@ } % % \end{macrocode} +% \subsection{Indexed objects} +% 2024-04-11: Temporary code! Can be removed after the next expl3 release! +% \begin{macrocode} +\cs_if_free:NT \pdf_object_new_indexed:nn + { + \cs_generate_variant:Nn \pdf_object_new:n {e} + \cs_generate_variant:Nn \pdf_object_write:nnn {enn} + \cs_new_protected:Npn \pdf_object_new_indexed:nn #1 #2 + { + \pdf_object_new:e {#1/\int_eval:n{#2}} + } + \cs_new_protected:Npn \pdf_object_write_indexed:nnnn #1 #2 #3 #4 + { + \pdf_object_write:enn {#1/\int_eval:n{#2}}{#3}{#4} + } + \cs_generate_variant:Nn \pdf_object_write_indexed:nnnn {nnne} + \cs_new:Npn\pdf_object_ref_indexed:nn #1 #2 + { + \pdf_object_ref:e {#1/\int_eval:n{#2}} + } + \cs_new:Npn \__kernel_pdf_object_id_indexed:nn #1 #2 + { + \int_use:c + { c__pdf_object_ #1/\int_eval:n{#2} _int } + } + } +% \end{macrocode} % \subsection{a LastPage label} % See also issue \#2 in Accessible-xref % \begin{macro}{\@@_lastpagelabel:}