[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: draft for xdvipdfmx last list implementation (e976112)
Ulrike Fischer
fischer at troubleshooting-tex.de
Mon Dec 28 20:00:20 CET 2020
Repository : https://github.com/latex3/pdfresources
On branch : reworking-annot
Link : https://github.com/latex3/pdfresources/commit/e9761126bbfae85cc1c87a979ad61cfce1eef34a
>---------------------------------------------------------------
commit e9761126bbfae85cc1c87a979ad61cfce1eef34a
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Mon Dec 7 15:14:09 2020 +0100
draft for xdvipdfmx last list implementation
>---------------------------------------------------------------
e9761126bbfae85cc1c87a979ad61cfce1eef34a
experiments/get-xdvipdfmx-version.tex | 58 +++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/experiments/get-xdvipdfmx-version.tex b/experiments/get-xdvipdfmx-version.tex
new file mode 100644
index 0000000..569a7d9
--- /dev/null
+++ b/experiments/get-xdvipdfmx-version.tex
@@ -0,0 +1,58 @@
+\documentclass{article}
+\usepackage{l3pdf}
+\ExplSyntaxOn
+\pdf_uncompress:
+
+\str_new:N \g_sys_dvipdfmx_version_str %Name?
+\str_gset:Nn\g_sys_dvipdfmx_version_str {0} %or whatever
+
+\int_new:N \g__pdf_backend_link_int
+
+\cs_set_protected:Npn \__pdf_backend_link_begin:n #1
+ {
+ \int_gincr:N \g__pdf_backend_object_int
+ \int_gset_eq:NN \g__pdf_backend_link_int \g__pdf_backend_object_int
+ \__pdf_backend:x
+ {
+ bann ~
+ \int_compare:nNnF { \g_sys_dvipdfmx_version_str } < {20201111}
+ {
+ @pdf.obj \int_use:N \g__pdf_backend_object_int \c_space_tl
+ }
+ <<
+ /Type /Annot
+ #1
+ >>
+ }
+ }
+
+\cs_set:Npn \__pdf_backend_link_last:
+ {
+ \int_compare:nNnF { \g_sys_dvipdfmx_version_str } < {20201111}
+ {@pdf.obj \int_use:N \g__pdf_backend_link_int} }
+
+%recover real version:
+\cs_new:Npn \__sys_extractbb_version:w #1n#2C#3\q_stop
+ {
+ \str_gset:Nn\g_sys_dvipdfmx_version_str{#2}
+ }
+\sys_get_shell:nnN{extractbb~--version}{}\l_tmpa_str
+\exp_last_unbraced:No \__sys_extractbb_version:w \l_tmpa_str\q_stop
+
+\ExplSyntaxOff
+\begin{document}
+\ExplSyntaxOn
+\__pdf_backend_link_begin_user:nnw {}
+ {
+ /Subtype/Link
+ /A<<
+ /Type/Action
+ /S/URI
+ /URI(https://www.latex-project.org)
+ >>
+ }
+some~text
+\__pdf_backend_link_end:
+\special{pdf:~put~\__pdf_backend_link_last:\c_space_tl << /F~16 >>}
+\ExplSyntaxOff
+\end{document}
\ No newline at end of file
More information about the latex3-commits
mailing list.