[Tex/LaTex] PDF/A with Linux Libertine und Linux Biolinum using pdfLaTeX

fontsluatexpdftexpdfxsymbols

I'd like to produce a PDF/A-1b compliant document. To validate it, I installed veraPDF.

There are several really good answers about producing PDF/A, see here:
https://tex.stackexchange.com/a/349521/4736 and https://tex.stackexchange.com/a/295137/4736 by @Leonid.


EDIT:

I can produce a validated, PDF/A-1B conform PDF using the LuaLaTeX engine, see the example at the end of this question. But I'd like to stick to pdfTeX for the time being, because it is a lot faster than LuaLaTeX.


I produced a pdf file based on the MWE printed below using pdfLaTeX.

The validation tells me, there are two kinds of issues with the PDF, I'm copying from the validation report:

Rule Status
Specification: ISO 19005-1:2005, Clause: 6.3.6, Test number: 1
For every font embedded in a conforming file and used for rendering, the glyph width information in the font dictionary and in the embedded font program shall be consistent. Failed
6 occurrences Hide
Glyph
renderingMode == 3 || isWidthConsistent == null || isWidthConsistent == true

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0 obj PDContentStream)/operators[11]/usedGlyphs3(FVQJUG+LinBiolinumB 115 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0 obj PDContentStream)/operators[31]/usedGlyphs2(YKWZWP+LinBiolinum 110 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0 obj PDContentStream)/operators[31]/usedGlyphs[5](YKWZWP+LinBiolinum 111 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0 obj PDContentStream)/operators[34]/usedGlyphs1(WJGWGZ+LinBiolinumI 117 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0 obj PDContentStream)/operators[19]/usedGlyphs[6](JSDWAF+LinLibertineI 99 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0 obj PDContentStream)/operators[34]/usedGlyphs[0](WJGWGZ+LinBiolinumI 97 0)

Specification: ISO 19005-1:2005, Clause: 6.3.5, Test number: 1
Embedded font programs shall define all font glyphs referenced for
rendering with conforming file. Failed 6 occurrences
Hide Glyph
renderingMode == 3 || isGlyphPresent == null || isGlyphPresent ==
true
root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0
obj PDContentStream)/operators[11]/usedGlyphs3(FVQJUG+LinBiolinumB
115 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0
obj PDContentStream)/operators[19]/usedGlyphs[6](JSDWAF+LinLibertineI
99 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0
obj PDContentStream)/operators[34]/usedGlyphs1(WJGWGZ+LinBiolinumI
117 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0
obj PDContentStream)/operators[31]/usedGlyphs2(YKWZWP+LinBiolinum
110 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0
obj PDContentStream)/operators[31]/usedGlyphs[5](YKWZWP+LinBiolinum
111 0)

root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0
obj PDContentStream)/operators[34]/usedGlyphs[0](WJGWGZ+LinBiolinumI
97 0)

How can I find out, which glyphs the validation refers to? Which glyph is »LinBiolinumI 97 0«?

Here my (stolen — steal proudly!) MWE for pdfLaTeX:

\documentclass[ngerman]{scrartcl}
\pdfminorversion 4
\pdfcompresslevel=0
\immediate\pdfobj stream attr{/N 4} file{coated_FOGRA39L_argl.icc}
\pdfcatalog{%
/OutputIntents [ <<
/Type /OutputIntent
/S/GTS_PDFA1
/DestOutputProfile \the\pdflastobj\space 0 R
/OutputConditionIdentifier (Coated FOGRA39)
/Info(FOGRA39L)
>> ]
}
\usepackage[cmyk]{xcolor}
\usepackage{hyperxmp}
\usepackage[pdftex, pdfa]{hyperref}
\hypersetup{%
  colorlinks = true,
    pdfauthor          = {a},
    pdfkeywords        = {a, b, c},
    pdflang            = {en},
    pdftitle           = {a},
    pdfsubject         = {a},
  pdfcaptionwriter   = {a},
  pdfcontactaddress  = {a},
  pdfcontactcity     = {a},
  pdfcontactcountry  = {a},
  pdfcontactemail    = {a},
  pdfcopyright       = {a},
  pdfmetalang        = {en},
}

\makeatletter
% Dirty hack of hyperref to make rgb-like links annotated with C mark become annotated with K mark to work in PDF/A with CMYK
% makeatletter - makeatother needed
\usepackage{etoolbox}
\patchcmd{\hyper@linkfile}{/C[}{/K[}{}{}
\patchcmd{\hyper@linkurl}{/C[}{/K[}{}{}
\patchcmd{\find@pdflink}{/C[}{/K[}{}{}
\patchcmd{\hyper@linkstart}{/C[}{/K[}{}{}
\makeatother

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{libertine}
\begin{document}
\section{Erster Abschnitt}
\label{CLA:erster-abschnitt}

Ein Text mit \emph{Auszeichnung} und sogar \textbf{fettem} Text, sogar {\sffamily{}
  LinBiolium als Schrift \emph{auch noch hervorgehoben}}. 


\end{document}

I found a discussion with similiar topic in a German forum, but the question has not been answered there.

And by the way: if I use the pdfx package, I get more or less the same validation issues, but unfortunately plus an issue with color.


EDIT

Thanks to a comment I tested succesfully using the LuaLaTeX engine. The following example led to a validated PDF/A-1B pdf:

\RequirePackage{luatex85}
\documentclass[ngerman]{scrartcl}
\pdfminorversion 4
\pdfcompresslevel=0
\immediate\pdfobj stream attr{/N 4} file{coated_FOGRA39L_argl.icc}
\pdfcatalog{%
/OutputIntents [ <<
/Type /OutputIntent
/S/GTS_PDFA1
/DestOutputProfile \the\pdflastobj\space 0 R
/OutputConditionIdentifier (Coated FOGRA39)
/Info(FOGRA39L)
>> ]
}
\usepackage[cmyk]{xcolor}
\usepackage{etoolbox}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
% % \usepackage[T1]{fontenc}
% % \usepackage[utf8]{inputenc}
% \usepackage{babel}
\usepackage{libertine}
\usepackage{hyperxmp}
\usepackage[pdftex, pdfa]{hyperref}
\hypersetup{%
  colorlinks = true,
    pdfauthor          = {a},
    pdfkeywords        = {a, b, c},
    pdflang            = {en},
    pdftitle           = {a},
    pdfsubject         = {a},
  pdfcaptionwriter   = {a},
  pdfcontactaddress  = {a},
  pdfcontactcity     = {a},
  pdfcontactcountry  = {a},
  pdfcontactemail    = {a},
  pdfcopyright       = {a},
  pdfmetalang        = {en},
}

\makeatletter
% Dirty hack of hyperref to make rgb-like links annotated with C mark become annotated with K mark to work in PDF/A with CMYK
% makeatletter - makeatother needed

\patchcmd{\hyper@linkfile}{/C[}{/K[}{}{}
\patchcmd{\hyper@linkurl}{/C[}{/K[}{}{}
\patchcmd{\find@pdflink}{/C[}{/K[}{}{}
\patchcmd{\hyper@linkstart}{/C[}{/K[}{}{}
\makeatother


\begin{document}
\section{Erster Abschnitt}
\label{CLA:erster-abschnitt}

Ein Text mit \emph{Auszeichnung} und sogar \textbf{fettem} Text, sogar {\sffamily{}
  LinBiolium als Schrift \emph{auch noch hervorgehoben}}. 


\end{document}

Which is usefull, but I'd really appreciate a solution for pdfLaTeX!

Best Answer

The following example led to a validated PDF/A-1B pdf […] Which is usefull, but I'd really appreciate a solution for pdfLaTeX!

I allowed myself to remove some stuff that was not related to the problem. This example works well in pdftex 3.14159265-2.6-1.40.21 and validates in Preflight and VeraPDF 1.14.8:

%\pdfobjcompresslevel=0 %uncomment for Texlive
\documentclass[ngerman]{scrartcl}

\usepackage{hyperxmp}[2020/03/01]
\usepackage[pdftex, pdfa]{hyperref}

\makeatletter
%Create an OutputIntent in order to correctly specify colours
\immediate\pdfobj stream attr{/N 3} file{sRGB.icc}
\edef\iccobj{\the\pdflastobj}
\pdfcatalog{%
  /OutputIntents [
    <<
      /Type /OutputIntent
      /S /GTS_PDFA1
      /DestOutputProfile \iccobj\space 0 R
      /OutputConditionIdentifier (sRGB)
      /Info (sRGB)
    >>
  ]
}
\makeatother

\hypersetup{%
    pdftitle={b},
    pdfauthor={a},
    pdflang=de,
    %keeppdfinfo=1, %uncomment for PDF/A-1
    pdfapart=2, %set to 1 for PDF/A-1
    pdfaconformance=B
}

\usepackage{babel}
\usepackage{libertine}

\begin{document}

\section{Erster Abschnitt}
\label{CLA:erster-abschnitt}

Ein Text mit \emph{Auszeichnung} und sogar \textbf{fettem} Text, sogar {\sffamily{}
  LinBiolium als Schrift \emph{auch noch hervorgehoben}}. 

\end{document}

I ran into one problem: After installing Biolinum I had to refresh the font map files in user (not administrator) mode.