PDFA compliance vs. pdf metadata with newtx

hyperxmpnewtxpdfpdfx

According to pages 28-29 of the documentation for the newtx package, version 1.704 (January 9, 2022), the following source includes the "elements [needed] to specify to generate a pdf satisfying the PDF/A-1b standards, as verified by Adobe Acrobat Pro."

With loading of the pdfx and hyperxmp packages along with the pdfa options in \hypersetup:

  • Adobe Acrobat Pro's File > Properties > Custom shows PDF/A-1b; but
  • Adobe Acrobat Pro's File > Properties > Description shows values only for the metadata items Title and Subject but not for Author or Keywords.

On the other hand, if I comment out loading pdfx, then:

  • Acrobat Pro's File > Properties > Custom no longer shows PDF/A-1b; and now
  • Acrobat Pro's File > Properties > Description also shows values for Author and Keywords metadata.

I'm using Adobe Acrobat Pro version 2021.011.20039, pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2022/dev), LaTeX2e <2021-11-15> patch level 1 with L3 programming layer <2022-01-21>.

Question: How can I get all the indicated metadata properties included in the pdf and, at the same time, have it verified by Acrobat Pro as PDF/A-1b compliant?

% !TEX TS-program = pdflatex
\begin{filecontents*}{\jobname.xmpdata}
  \Title{A Book}
  \Author{A. Nonymous}
  \Language{en}
  \Subject{A General Introduction to Things}
  \Keywords{things\sep stuff}
  \Publisher{My Self, Inc.}
  \Copyright{Creative Commons by-nc-nd}
\end{filecontents*}

\documentclass{article}

% To examine pdf as pure ASCII:
\pdfcompresslevel=0
\pdfobjcompresslevel=0
\input glyphtounicode
\usepackage{pdfx} % v 1.6.4 or higher
\InputIfFileExists{glyphtounicode-cmr.tex}{}{}
\InputIfFileExists{glyphtounicode-ntx.tex}{}{}
\usepackage[T2A,T1]{fontenc} 
\usepackage{substitutefont} % to allow non-default Cyrillic
\usepackage[russian,ngerman,polish,english]{babel}
\babeltags{russian=russian,french=french,german=ngerman,polish=polish}%
\substitutefont{T2A}{\rmdefault}{Tempora-TLF} % for Cyrillic
\usepackage[type1,sfdefault,scale=1]{sourcesanspro}% used by \mathsf
\usepackage[nohelv,amsthm,largesc,trueslanted,vvarbb,smallerops]{newtx}
\usepackage[varqu,varl]{inconsolata} % typewriter  

\usepackage{hyperxmp}
\RequirePackage[type={CC},modifier={by-nc-nd},version={4.0},lang={english}]{doclicense}
\usepackage{datetime2} % to satisfy the "\today" in \hypersetup
\DTMusemodule{english}{en-US}

\usepackage{hyperref}
\hypersetup{
  pdfapart=2, pdfaconformance=u,
  bookmarksnumbered,
  pdftitle={A Book},
  pdfauthor={A. Nonymous},
  pdfcreator={somebody},
  pdfpublisher={My Self, Inc.},
  pdfsubject={A General Introduction to Things},
  pdfkeywords={things, stuff},
  pdfdate={\today},
  pdflang={en},pdfmetalang={en},
  pdflicenseurl={http://creativecommons.org/licenses/by-nc-nd/4.0/}
}

\pdfgentounicode=1
\pdfglyphtounicode{EM}{0058 0058 0058 0058 0058 0058 0058 0058}%
\pdfglyphtounicode{NUL}{0060 0060 0060 0060 0060 0060 0060 0060}%
\pdfglyphtounicode{uni222B.dsp}{222B}%
\pdfglyphtounicode{summationdisplay.1}{0060 0060 0060 0060 0060 0060 0060 0060}%
\pdfglyphtounicode{summationdisplay}{0060 0060 0060 0060 0060 0060 0060 0060}%    
\pdfglyphtounicode{radicalBigg}{0060 0060 0060 0060 0060 0060 0060 0060}%
\pdfglyphtounicode{radicalbig}{0060 0060 0060 0060 0060 0060 0060 0060}%
\pdfglyphtounicode{radicalbigg}{0060 0060 0060 0060 0060 0060 0060 0060}%
\immediate\pdfobj stream attr{/N 3} file{sRGB.icc}
\pdfcatalog{%
    /OutputIntents [
     <<
         /Type /OutputIntent
         /S /GTS_PDFA1
         /DestOutputProfile \the\pdflastobj\space 0 R
         /OutputConditionIdentifier (sRGB)
         /Info (sRGB)
      >>
  ]
}

\usepackage{blindtext}

\begin{document}

To be finished!

\blindmathpaper

\end{document}

Best Answer

The following code (updated 2023-10) pass the preflight test for pdf/A-1b. It requires a current latex/tex system (so e.g an up-to-date texlive 2023)

\DocumentMetadata{pdfstandard=a-1b}
\documentclass{article}

\usepackage[T2A,T1]{fontenc}
\usepackage[russian,ngerman,polish,english]{babel}
\babeltags{russian=russian,french=french,german=ngerman,polish=polish}%
\DeclareFontFamilySubstitution{T2A}{\rmdefault}{Tempora-TLF} % for Cyrillic
\usepackage[type1,sfdefault,scale=1]{sourcesanspro}% used by \mathsf
\usepackage[nohelv,amsthm,largesc,trueslanted,vvarbb,smallerops]{newtx}
\usepackage[varqu,varl]{inconsolata} % typewriter

\RequirePackage[type={CC},modifier={by-nc-nd},version={4.0},lang={english}]{doclicense}
\usepackage{datetime2} % to satisfy the "\today" in \hypersetup
\DTMusemodule{english}{en-US}

\usepackage{hyperref}
\hypersetup{
  bookmarksnumbered,
  pdftitle={A Book},
  pdfauthor={A. Nonymous},
  %pdfcreator={somebody},
  pdfproducer=pdfTeX-1.40.23, %why needed ????????????
  pdfpublisher={My Self, Inc.},
  pdfsubject={A General Introduction to Things},
  pdfkeywords={things, stuff},
  pdfdate={\today},
  pdflang={en},pdfmetalang={en},
  pdflicenseurl={http://creativecommons.org/licenses/by-nc-nd/4.0/}
}


\pdfglyphtounicode{EM}{0058 0058 0058 0058 0058 0058 0058 0058}%
\pdfglyphtounicode{NUL}{0060 0060 0060 0060 0060 0060 0060 0060}%
\pdfglyphtounicode{uni222B.dsp}{222B}%
\pdfglyphtounicode{summationdisplay.1}{0060 0060 0060 0060 0060 0060 0060 0060}%
\pdfglyphtounicode{summationdisplay}{0060 0060 0060 0060 0060 0060 0060 0060}%
\pdfglyphtounicode{radicalBigg}{0060 0060 0060 0060 0060 0060 0060 0060}%
\pdfglyphtounicode{radicalbig}{0060 0060 0060 0060 0060 0060 0060 0060}%
\pdfglyphtounicode{radicalbigg}{0060 0060 0060 0060 0060 0060 0060 0060}%

\usepackage{blindtext}

\begin{document}

To be finished!

\blindmathpaper

\end{document}

I don't know why setting the pdfproducer is needed, but it is too late now to check.

Related Question