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 == trueroot/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!
hyperref
should be loaded last excepting known exceptions (e.g.cleveref
). Also\sffamily
doesn't take an argument. Are you trying to insert an extra space or something? – cfr Jan 10 '18 at 1:15\usepackage{lmodern}
instead of libertine, more of the kindroot/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](10 0 obj PDContentStream)/operators[45]/font[0](ZTXVEC+LMRoman10-Regular)
. I moved every\usepackage
before hyperref. – Keks Dose Jan 10 '18 at 8:19fontenc
, but I wonder: Have you tried compiling your document in pdflatex, using the LY1 encoding? Looking at the validation results, it seems that the offending characters are from the upper range of Latin-1. I believe that LY1 (texnansi) maps these correctly. But again, that's a guess. – user139954 Jan 10 '18 at 15:22