3

I want to produce a PDF/A-1b compliant document. I am using pdflatex (MikTex 2.9) and TeXnicCenter. On the web, I've read that the "pdfx" package is the best way to do this. I installed pdfx according to the instruction on the web and it seems to be working.

However, as soon as I start to implement "\usepackage[a-1b]{pdfx}" into my tex-file, the links in my document do not longer work, i.e. I cannot click on the link to switch to the destination of it, e.g. for referencing sections or citing bibliography entries.

Looking at "pdfx.sty" revealed that the "hyperref" package is loaded with the option "draft":

\RequirePackage[draft,pdftex,pdfpagemode=UseNone,bookmarks=false]{hyperref}

I tried to change this option using \hypersetup{final}, but this did not work.

I also tried changing the corresponding line in "pdfx.sty" directly to

\RequirePackage[final,pdftex,pdfpagemode=UseNone,bookmarks=false]{hyperref}

but this didn't work either (I updated the Miktex file name database before I ran pdflatex).

Also, changing the link-appearence, e.g. its color, cannot be manipulated either (see example).

Could someone please tell me if it's possible to have working links within a pdf document that has been created with the "\usepackage[a-1b]{pdfx}" command?

Here's an MWE:

\documentclass{book}

\usepackage[a-1b]{pdfx}
\usepackage{lipsum}

% Appearance of links cannot be manipulated
\hypersetup{linkcolor = {0 0 1}}

% Activating "Final" option does not influence links
\hypersetup{final = true}

\begin{document}

\chapter{Dummy title 1}
\label{label_1}
\lipsum

\chapter{Dummy title 2}
Make reference to chapter \ref{label_1}

\end{document}
7
  • Is your document compiling properly? When I tried it, it got a pdfTeX error because a color definition file wasn't there (Read Errors using pdfx package to generate PDF/A for more information). Please check out the last bit of your log-file.
    – Johannes_B
    Dec 16, 2013 at 18:07
  • If I say \hypersetup{colorlinks,linkcolor=blue} I get a blue colored link from the reference to the chapter title. Whether this is a valid PDF/X file I don't know.
    – egreg
    Dec 16, 2013 at 18:36
  • @Johannes_B: I needed to download a color profile ("sRGBIEC1966-2.1.icm") and place it in the "tex/latex/pdfx" folder to compile the document. But after this, it compiled properly.
    – Christof
    Dec 17, 2013 at 8:55
  • @egreg: Using '\hypersetup{colorlinks,linkcolor=blue}' as you suggested indeed changes the appearance of the link. However, I still cannot click on the link to switch to the referenced chapter...
    – Christof
    Dec 17, 2013 at 8:57
  • @Christof My link works, so I don't know what to say.
    – egreg
    Dec 17, 2013 at 8:58

2 Answers 2

2

Hyperlinks should work just fine in a PDF/A document, using pdfx --- but please send me any example that you find where this is not the case.

However active actions are forbidden in a PDF/X, which standard is intended only for accurate high-quality printing.

One of the new features in pdfx (v.1.5.8) is to enforce this in PDF/X documents, by patching hyperref's coding for links, but respecting any colors specified for the link's anchor-text. Another improvement is to force the use of xcolor, adapting to the nature of the color profile that has been specified; normally RGB for PDF/A or CMYK for PDF/X. This is to ensure that any colors specified in whatever way in other packages, or with \definecolor end up matching the chosen color model. Otherwise the PDF might not pass validation.

0

On the web, I've read that the "pdfx" package is the best way to do this.

That is the mistake. PDF/A-1a is mostly about correct metadata. Package hyperxmp cares about metadata. The only thing you have to add for a working PDF/A-1a is an OutputIntent for colour management.

MWE

%\pdfobjcompresslevel=0 %uncomment for Texlive
\documentclass{book}

\usepackage{lipsum}
\usepackage[pdfa]{hyperref}
\usepackage{hyperxmp}

\hypersetup{%
    pdftitle={title},
    pdfauthor={author},
    pdflang=la,
    %pdfcreator={pdfLaTeX}, %uncomment for PDF/A-1
    %pdfproducer={pdfLaTeX}, %uncomment for PDF/A-1
    %keeppdfinfo=1, %uncomment for PDF/A-1
    pdfapart=2, %set to 1 for PDF/A-1
    pdfaconformance=B
}

\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

% Appearance of links /can/ be manipulated
\hypersetup{colorlinks, linkcolor = green}

\begin{document}

\chapter{Dummy title 1}
\label{label_1}
\lipsum

\chapter{Dummy title 2}
Make reference to chapter \ref{label_1}

\end{document}

This example validates in Acrobat DC and 3 heights, using LuaLaTeX and pdfLaTeX in MikTeX. It has clickable links and you can define the colours as described in hyperref manual.

Instead of using PDF/A-1a I recommend PDF/A-2a. The difference is that 1 stores some metadata twice in XMP and DocumentInfo. It is more elegant not to have redundant metadata.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .