I would like to create invisible bookmarks/anchor points in my PDF. I want something like \pdfbookmark
but with an invisible parameter. Does this exist?
After experiments and reading, I determined that PDFs have anchors of two types:
(comments from the perspective of an outline in a PDF viewer)
- bookmarks (visible
\pdfbookmark{bookmark}{hyperrefuid}
) - named destinations (invisible
\hypertarget{nameddestination}{bodytext}
)
It seems that XeLaTeX is not able to create named destinations, unless I am doing something wrong. Named destinations by hyperref broken for XeTeX 3.14159265-2.6-0.99992 (TeX Live 2015/dev/Debian)
What do I mean? I mean literally a bookmark's text does not show up in the list of bookmarks when opened in a PDF viewer, but does show up when opened in something like PDFedit
.
Specified in the Adobe PDF Standards Documentation http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf
I tried searching for "hidden" or "invisible" in the hyperref
and extension of that bookmark
package, but I did not find any results.
Situation
I have a PDF with many languages as parts
.
- Danish da
- German de
- Greek el
- English en
- Spanish es
- Italian it
- Dutch nl
- Norwegian (general) no
- Portugese pt
- Turkish tr
If a program is configured to run in language German, then the application will automatically jump to the beginning of the German language.
Implementation
I'd like to add a hidden bookmark at the beginning of each \ithinputlanguagefile
. I could use #1
for the bookmark text.
% #1 = de
% #2 = German
% #3 = file
\newcommand{\ithinputlanguagefile}[3]{%
\bookmarksetupnext{bold,open=false} % setup bookmark
\newpage\pdfbookmark{#2}{bkm#1}%\pdfbookmark[level]{text}{internalNameId} from hyperref
\phantomsection % Necessary to correct link in Language Directory
\etoctoccontentsline{part}{#2}%
\setcounter{section}{0}% reset section so first sec in new lang starts at 1
\renewcommand*{\theHsection}{chX.\the\value{runningsectioncounter}} % Keeps hyperref happy (provides unique section numbers instead of using the section counter)
\input{#3}%input the language file
}
This results in a list of language names in my bookmarks. I also would like invisible bookmarks whose "text" is something like #1
in this example, but is not visible in bookmarks when opened with a pdf viewer.
Example
I would hope that this question does not need a minimal example. I could provide one upon request.