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
tex.error("PDF version cannot be changed anymore")
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?
pdfx
.\expandafter
's missing, e.g. like this\expandafter\hypersetup\expandafter{\pdfx@pdfAE@opts@xetex}
pdfx
with one of the pdfa-options, thenhyperref
's own optionpdfa
is loaded which sets the pdf version back to 1.4:\kvsetkeys{Hyp}{pdfversion=1.4}