# Creating valid PDF/A-3B via XeLaTeX with custom fonts

I need to generate a valid PDF/A-3B document from my .tex file. My preferred compiler is XeLaTeX. Also, it's necessary for me to have an ability to change a font in any time and recompile this document.

I tried to use pdfx with fontspec and validated produced file with veraPDF software tool. This tool says that my PDF document is not valid with next message:

"If the FontDescriptor dictionary of an embedded CID font contains a CIDSet stream, then it shall identify all CIDs which are present in the font program, regardless of whether a CID in the font is referenced or used by the PDF or not."

Here is an example of simple document:

\documentclass[a4paper,11pt]{report}
\usepackage[
showframe       % show the main block
]{geometry}
\usepackage[a-3b]{pdfx}
\usepackage{fontspec}
\setmainfont{LiberationSans}
\begin{document}
Some text in file
\end{document}


Compiling command is:

xelatex -shell-escape -output-driver="xdvipdfmx -z 0" test1.tex


Output of pdffonts:

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
EBDSBK+LiberationSans                CID TrueType      Identity-H       yes yes yes      9  0


Is there any solution to produce PDF/A-3B valid document with XeLaTeX ?

• I did some search for "CIDset stream" and discovered a variety of sites that mention a similar problem. Apparently you are not alone, and it is not specific to XeTeX (or any TeX). Also whether or not the error is detected seems to depend on the validator. Bottom line: I would be very surprised if even the experts here (I am not one of them) can help with this. It seems to be a guts-level issue. My suggestion: For each font in use, try placing a hard space character \char"20 somewhere in the document. That may help, and will not hurt. – user103221 Apr 4 '17 at 14:57
• Thanks for your comment, @RobtA, but unfortunately, I received the same issue. – b00blik Apr 4 '17 at 15:24
• Ah, my earlier comment was an unlucky guess, based on some very slightly related experience with LuaLaTeX and document reflow. Thought that there might be a relationship. No. – user103221 Apr 4 '17 at 16:36