Make a href link open multiple pages

hyperreflinksurls

I've already found a solution to open "only" two links, see How to make a link open multiple pages when clicked

Is there a possibilty to open 3 and more hyperlinks e.g. https://example1.com, https://example2.com, https://example3.com, https://example4.com with one click – possibly with expanding the following example for 2 links (which works here)?

\documentclass{article}
\usepackage{hyperref}
\begin{document}
  \href[%
    nextactionraw={%
      <<%
        /Type/Action%
        /S/URI%
        /URI(https://example2.com/)%
      >>%
    }%   
  ]{https://example1.com/}{Open my list}
\end{document}

Best Answer

The "next action" option can contain an array, the actions in it are then executed in order. Every action dictionary can also contain an /Next key, which means that you can even have a tree of actions. (The specifications says that PDF processors should "attempt to provide reasonable behaviour", which means if you confuse them too much it is your fault ;-)).

An array in PDF is built by using bracket [...]:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
  \href[%
    nextactionraw={%
    [
      <<%
        /Type/Action%
        /S/URI%
        /URI(https://example2.com/)%
      >>%
      <<%
        /Type/Action%
        /S/URI%
        /URI(https://example3.com/)%
      >>%    
     ] 
    }%
  ]{https://example1.com/}{Open my list}
\end{document}
Related Question