The following code doesn't compile (with pdflatex
)
\documentclass{article}
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage[pdfa=true]{hyperref}
\begin{document}
Hello.
\end{document}
unless I omit either the fontenc
-line or the pdfa=true
-option from the hyperref
-line. The error message I get says: ! pdfTeX error (setup): \pdfminorversion cannot be changed after data is written to the PDF file.
Is there something I can do or is this an incompatibility?
Best Answer
The fatal error you get is
Using
\tracingall
, this can be tracked down a bit more to the\AtBeginDocument
hook. What it looks like is thathyperref
wants to set some PDF settings at the start of the document when given thepdfa=true
option. Normally, nothing will have been written to the PDF at that stage, so all is fine, butcmap
has already written to the PDF so breaks this. The solution is to loadcmap
afterhyperref
.