This here works fine for me with texlive 2020 on windows:
\RequirePackage{expl3}
\ExplSyntaxOn
\pdf_version_gset:n{2.0}
\pdf_uncompress: % to check the pdf
\ExplSyntaxOff
\documentclass{report}
\begin{document}
abc
\end{document}
\pdf_version_gset:n{2.0}
works also with other engines, so I prefer it over the xetex specific command.
The pdf then starts with
%PDF-2.0
hyperref
sets the version too. So if you use it you can
- reset the version after loading it
- or use the new pdfmanagement and set the version there
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{pdfversion=2.0,uncompress}
\documentclass{report}
\usepackage{hyperref}
\begin{document}
abc
\end{document}
- or set the version with hyperref. Be aware that hyperref can only do it if no package or code before has already opened the pdf, so you should check if it worked.
\documentclass{report}
\usepackage[pdfversion=2.0]{hyperref}
\begin{document}
abc
\end{document}
\special{pdf:majorversion 2} \special{pdf:minorversion 0} hello \bye
works for me. The PDF file starts with%PDF-2.0
, and Acrobat reports 2.0 as well.pdf:majorversion 2
was only added for TL 2021...(x)dvipdfmx
on Windows at least for this