Consider the following example using the package pdfx version 1.5.8, setting the PDF version as suggested in https://tex.stackexchange.com/a/202301/99345 for LuaTeX 0.95:

\directlua{
if pdf.getminorversion() \string~= 7 then
if (status.pdf_gone and status.pdf_gone > 0)
or (status.pdf_ptr and status.pdf_ptr > 0) then
else
pdf.setminorversion(7)
end
end
}

\documentclass{article}
\usepackage[a-2b]{pdfx}

\begin{document}
Content
\end{document}


When building the PDF output with LuaTeX version 1.0.4, the following error occurs:

! error:  (pdf backend): minorversion cannot be changed after data is written to the PDF file
!  ==> Fatal error occurred, no output PDF file produced!


Omitting the package pdfx produces a PDF document with the correct version number 1.7 set. How can the desired PDF version number be set in combination with LuaTeX and pdfx?

• As pdfx sets the minor version too, you can't set it before loading the package. pdfx has an option (pdf17) to set it, but due to a bug (hyperref options are not passed correctly) it has no effect. May 15, 2017 at 12:14
• @UlrikeFischer: Is that bug known to the package developers? I could not find a bug tracker for pdfx. May 16, 2017 at 13:26
• I didn't reported it, I didn't had the time yet (and also wanted to assemble a number of suggestion first). Write Ross a mail. It is mostly \expandafter's missing, e.g. like this \expandafter\hypersetup\expandafter{\pdfx@pdfAE@opts@xetex} May 16, 2017 at 14:14
• Are there any news here? Oct 27, 2017 at 16:01
• Well, when loading pdfx with one of the pdfa-options, then hyperref's own option pdfa is loaded which sets the pdf version back to 1.4: \kvsetkeys{Hyp}{pdfversion=1.4} Nov 13, 2017 at 20:42

There was a bug in hyperref versions prior to v6.86a with the pdfa option, which set the PDF always to version 1.4. The latest version of hyperref (>6.86a) fixes that problem.