Hyperref – How to Generate PDF 1.7 Output with LuaLatex

hyperrefluatexpdf

LuaLatex Version 1.13.2 (TeX Live 2021) prints a warning (pdf inclusion): PDF inclusion: found PDF version '1.7', but at most version '1.5' allowed

How should I generate PDF 1.7 files? Hyperref has an option pdfversion, but the documentation starts with "This is an experimental option."

Best Answer

hyperref should work, the only problem can be that there can be packages which already open the pdf and then hyperref is too late. Before \documentclass you can set the version like this:

\ExplSyntaxOn             % Switch on expl3 syntax
\sys_ensure_backend:      % load the backend code
\pdf_version_gset:n{1.7}  % Use provided expl3 function
\ExplSyntaxOff            % Switch off expl3 syntax
\documentclass{article}
...

With an older LaTeX that doesn't know \sys_ensure_backend: this will work:

\RequirePackage{expl3}    % \usepackage cannot be used before \documentclass
\ExplSyntaxOn             % Switch on expl3 syntax
\pdf_version_gset:n{1.7}  % Use provided expl3 function
\ExplSyntaxOff            % Switch off expl3 syntax

\documentclass{article}
...

or (requires a current lualatex-dev and is a bit experimental as it loads the new pdfmanagement)

\DocumentMetadata{pdfversion=1.7}
\documentclass{article}