[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: experiment link reinsertion (70c7669)
Ulrike Fischer
fischer at troubleshooting-tex.de
Sat Mar 23 16:49:21 CET 2019
Repository : https://github.com/latex3/pdfresources
On branch : testlinkstuff
Link : https://github.com/latex3/pdfresources/commit/70c7669b24f0df24d75bbe2c0be0dbe18072cb33
>---------------------------------------------------------------
commit 70c7669b24f0df24d75bbe2c0be0dbe18072cb33
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sat Mar 23 16:49:21 2019 +0100
experiment link reinsertion
>---------------------------------------------------------------
70c7669b24f0df24d75bbe2c0be0dbe18072cb33
experiments/luatex-reinsert-link.tex | 51 ++++++++++++++++++++++++++++++++++
experiments/testinput.pdf | Bin 0 -> 22243 bytes
2 files changed, 51 insertions(+)
diff --git a/experiments/luatex-reinsert-link.tex b/experiments/luatex-reinsert-link.tex
new file mode 100644
index 0000000..59177a3
--- /dev/null
+++ b/experiments/luatex-reinsert-link.tex
@@ -0,0 +1,51 @@
+\documentclass{article}
+\usepackage{tagpdf}
+\tagpdfsetup{uncompress}
+\usepackage{pdfpages}
+\newcommand\insertlink{
+\latelua{
+n = pdf.reserveobj()
+ pdf.obj(n, "<<
+/Type /Annot
+/Border[0 0 1]/H/I/C[0 1 1]
+/Rect ["..e[0].." "..e[1].." "..e[2].." "..e[3].."]
+/Subtype/Link/A<</Type/Action/S/URI/URI("..URI..")>>
+>>")
+ pdf.refobj(n)
+pdf.registerannot(n)}
+}
+
+\usepackage{luacode}
+\begin{luacode}
+
+a=pdfe.open("testinput.pdf").Pages[1]
+--print("XXXX",a)
+hash = pdfe.dictionarytotable(a)
+texio.write_nl(table.serialize(hash))
+b = pdfe.getarray(a,"Annots")
+print("BBBB",b)
+c = pdfe.getdictionary(b,0)
+print("CCCC",c)
+--hash = pdfe.dictionarytotable(c)
+--texio.write_nl(table.serialize(hash))
+
+d = pdfe.getarray(c,"Rect")
+print("DDDD",d)
+e = {}
+e[0] = pdfe.getnumber(d,0)
+e[1] = pdfe.getnumber(d,1)
+e[2] = pdfe.getnumber(d,2)
+e[3] = pdfe.getnumber(d,3)
+print("EEEE",e[0],e[1],e[2],e[3])
+
+action = pdfe.getdictionary(c,"A")
+print("FFFFFFF",action)
+URI = pdfe.getstring(action,"URI")
+print("GGGGG",URI)
+\end{luacode}
+
+\begin{document}
+%\insertlink blbbl
+bkbkb
+\includepdf[pagecommand={\insertlink}]{testinput}
+\end{document}
\ No newline at end of file
diff --git a/experiments/testinput.pdf b/experiments/testinput.pdf
new file mode 100644
index 0000000..21633a0
Binary files /dev/null and b/experiments/testinput.pdf differ
More information about the latex3-commits
mailing list