| 1 |
% needs |
| 2 |
%\usepackage{listings} |
| 3 |
%\usepackage{tikz} |
| 4 |
%\usetikzlibrary{fit,tikzmark} |
| 5 |
%\usetikzlibrary{arrows.meta} |
| 6 |
\lstset{basicstyle=\ttfamily, |
| 7 |
columns=flexible, |
| 8 |
escapechar=*, |
| 9 |
morecomment=[l]{\%},keepspaces=true, |
| 10 |
commentstyle=\color{green!50!black}\bfseries} |
| 11 |
\tikzset{ |
| 12 |
balloon/.style={ |
| 13 |
draw, |
| 14 |
fill=blue!20, |
| 15 |
opacity=0.4, |
| 16 |
inner xsep=4pt,inner ysep=2pt, |
| 17 |
rounded corners=2pt, |
| 18 |
%minimum height=15pt |
| 19 |
}, |
| 20 |
ref/.style={ |
| 21 |
very thick, -Latex,red |
| 22 |
}, |
| 23 |
iref/.style={ |
| 24 |
thick,dashed, -Latex,red |
| 25 |
} |
| 26 |
} |
| 27 |
\NewDocumentCommand\balloon{m}{% |
| 28 |
\node[fit={(pic cs:#1-first) (pic cs:#1-end) |
| 29 |
([yshift=7pt]pic cs:#1-end)},balloon](#1){};} |
| 30 |
\begin{tikzpicture}[overlay,remember picture,alt={Illustration of link annotation structure}] |
| 31 |
\balloon{link} |
| 32 |
\balloon{structparent} |
| 33 |
\balloon{OBJR} |
| 34 |
\balloon{linkref} |
| 35 |
\balloon{structelem} |
| 36 |
\balloon{kid} |
| 37 |
\balloon{pnum} |
| 38 |
\balloon{pref} |
| 39 |
\draw[ref] (linkref)--(link); |
| 40 |
\draw[ref] (link)--(structparent.170); |
| 41 |
\draw[ref] (structparent.190)--(pnum); |
| 42 |
\draw[ref] (pnum)--(pref); |
| 43 |
\draw[ref] (pref)--(structelem); |
| 44 |
\draw[ref] (structelem)--(kid); |
| 45 |
\draw[ref] (kid)--(OBJR); |
| 46 |
\draw[ref] (OBJR)--(linkref); |
| 47 |
\end{tikzpicture} |
| 48 |
\begin{lstlisting}[name=OBJR] |
| 49 |
*\tikzmark{link-first}*18 0 obj*\tikzmark{link-end}* %Link Object |
| 50 |
<< /Type /Annot /Subtype/Link |
| 51 |
/Rect [ 196.109 494.573 399.167 506.831 ] |
| 52 |
*\tikzmark{structparent-first}*/StructParent 16 *\tikzmark{structparent-end}* |
| 53 |
/A<</Type/Action /S/URI /URI(https://github.com/u-fischer/tagpdf)>> |
| 54 |
>> |
| 55 |
endobj |
| 56 |
|
| 57 |
*\tikzmark{OBJR-first}*19 0 obj*\tikzmark{OBJR-end}* %Object reference (OBJR) |
| 58 |
<</Type /OBJR /Obj *\tikzmark{linkref-first}*18 0 R*\tikzmark{linkref-end}* >> |
| 59 |
endobj |
| 60 |
|
| 61 |
*\tikzmark{structelem-first}*17 0 obj*\tikzmark{structelem-end}* %Structure Element |
| 62 |
<< /Type /StructElem /S /Link /P 11 0 R |
| 63 |
/K [<</Type /MCR /Pg 8 0 R /MCID 6>> *\tikzmark{kid-first}*19 0 R*\tikzmark{kid-end}* ]>> |
| 64 |
endobj}; |
| 65 |
|
| 66 |
5 0 obj %Parenttree |
| 67 |
<< /Nums |
| 68 |
[... *\tikzmark{pnum-first}*16*\tikzmark{pnum-end}* *\tikzmark{pref-first}*17 0 R*\tikzmark{pref-end}* ...] >> |
| 69 |
endobj |
| 70 |
\end{lstlisting} |