% !Mode:: "TeX:DE:UTF-8:Main"
% !! needs lualatex
% this sets the hyphen used by automatic hyphenation to 00AD
% this improves copy&pasting
% the example gives 
%  aaaaaaa-aaaaaa aaaaaaa-aaaaaa
%  Ministerpräsident
% when copied from adobe
% sumatra doesn't understand this and copies Mi­nisterprä­sident



\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{pdfversion=1.7,uncompress}
\documentclass{book}

\usepackage[ngerman]{babel} %to get some hyphenation
\usepackage{tagpdf}
\tagpdfsetup{tabsorder=structure,
             activate, %deactivate to see the difference
             interwordspace,
             paratagging
             }

\usepackage{fontspec}
% we must remove the invisible feature
\setmainfont{TeX Gyre Pagella}[RawFeature={-invisible}]
\prehyphenchar"AD

\pagestyle{empty}
\textwidth=1cm
\begin{document}

aaaaaaa-aaaaaa aaaaaaa-aaaaaa

Ministerpräsident

\end{document}


aaaaaaa-
aaaaaa
aaaaaaa-
aaaaaa
Mi­
nisterprä­
sident


aaaaaaa-aaaaaa aaaaaaa-aaaaaa
Ministerpräsident

aaaaaaa-aaaaaa aaaaaaa-aaaaaa
Ministerpräsident