I need to set the bookmark with character count limitations. For headings with more than 100 characters, only the first 100 characters should be shown, followed by an ellipsis (...). For headings with less than 100 characters, the full content should be displayed in the bookmark. (Compiling the file using lualatex-dev.exe)
MWE is below
\documentclass{article}
\usepackage{bookmark}
\usepackage{hyperref}
\begin{document}
\section{More than 100 character, Recent advances towards point-of-care devices for fungal detection: Emphasizing the role of plasmonic nanomaterials in current and future technologies}
The first section of this chapter consists of a brief and informal overview of the topics addressed in the book, in which only terms and notions familiar from traditional grammar and/or introductory courses in morphosyntax are used. Section 1.2 discusses the position taken by the author about some concepts generally considered basic for the analysis of clause structure and its semantic correlates, and the terms used to refer to them. Section 1.3 presents the framework within which transitivity, valency,
\section{Less than 100 character Section heading}
The first section of this chapter consists of a brief and informal overview of the topics addressed in the book, in which only terms and notions familiar from traditional grammar and/or introductory courses in morphosyntax are used. Section 1.2 discusses the position taken by the author about some concepts generally considered basic for the analysis of clause structure and its semantic correlates, and the terms used to refer to them. Section 1.3 presents the framework within which transitivity, valency,
\end{document}
My expected output is below:
\texorpdfstring{a short bookmark}{the original long TeX section title}
\section
because it would also shorten the entry in the ToC?