Creating a PDF/A file with pdfLaTex

  1. Set \pdfminorversion=7 at the very beginning of the LaTeX source file.
  2. Set the document metadata like this.
    	\begin{filecontents*}[overwrite]{\jobname.xmpdata}
    		\Title{Title of the PDF file}
    		\Author{Author's name}
    		\Language{en-us}
    		\Subject{A brief description of the contents}
    		\Keywords{keyword1\sep keyword2\sep keyword3}
    	\end{filecontents*}
    	
  3. Add the following lines after the \documentclass command.
    	\usepackage[utf8]{inputenc}
    	\usepackage[T1]{fontenc}
    	\usepackage[a-2b,mathxmp]{pdfx}
    	
  4. If the xcolor and the hyperref packages are included like \usepackage{hyprref}, comment out that line. (But, \hypersetup should not be commented out.)
    This is because the pdfx package loads the xcolor and the hyperref packages internally.
  5. Compile the LaTeX source, and check whether the created pdf is compliant with PDF/A by running "verapdf <filename>".
  6. If some errors and warnings appear, it may be due to included figures that are missing information on fonts or color maps. So, try compiling the LaTeX source in the draft mode, and chech if the errors and warnings remain.
    (For my case, none of the errors and warnings remained after this step. Therefore, I checked each of the included figures one by one.)