[Tex/LaTex] hyperref, natbib and PDF/A-compliance

hyperrefpdf-a

My e-Thesis submission is required to be in PDF/A-1b format, and I'm having difficulty producing output that meets this standard using LaTeX.

I have successfully typeset a chapter using dvips to produce a PostScript file, which can then be converted to PDF/A using Adobe Distiller (Acrobat Pro v8.1.2), BUT with the following issues:

  1. if I use hyperref with coloured links, the conversion fails, because the PS file is not PDF/A-compliant (see below)
  2. if I turn on draft mode in hyperref, the resulting PS file can be successfully output to PDF/A using Adobe Distiller, but then I get an error, sometimes 2, while typesetting the bibliography (generated with BibTeX and natbib using a custom bibliography style)

For 1) I have seen references to this known issue: hyperlinks are not incompatible with PDF/A per se, but hyperref does not include all the flags required for PDF/A compliance:
http://tug.org/mailman/htdig/pdftex/2008-January/007522.html
I tried editing hyperref.sty as suggested, but this did not seem to work for me (either when typesetting using pdftex, or through dvips). Acrobat still complained about missing Print and Annot flags for each link (citation and cross-references).

I can live with 2) for the official version (no links, but at least it will be 'archive-quality'). Nevertheless, the errors are incredibly annoying. Each bibliographic entry produces this error:

    Argument of \hyper@anchorstart has an extra }

and sometimes also:

    Paragraph ended before \hyper@anchorstart was complete.

These errors never happen when typesetting through pdflatex, even in draft mode. I need to produce a PS file for PDF/A-1b conversion, but these errors are a huge pain.

I can't fully disable hyperref, because I use the \autoref{} macro a lot, and I would rather not have to replace all those manually.

I also tried using the pdfx package (using the pdflatex driver), but got some strange errors very early on in the typesetting run:

/usr/local/texlive/2011/texmf-dist/tex/latex/pdfx/pdfx.sty:121: Use of \getTZh 
doesn't match its definition.
<inserted text> D:20121114223403-
                                 05'00'
l.121 \expandafter\convertDate\pdfcreationdate

I hope there is enough information above for people to suggest alternatives, or ways to fix the errors. I haven't put together a MWE, but I could probably throw one together if it would help.

Thanks for any help you can offer.

I am using TexLive 2011 on a Mac (OS X 10.6.8), document processing in TeXShop using simpdftex, Version 20070809
or
pdfTeX, Version 3.1415926-2.3-1.40.12

Best Answer

I'm not sure if an answer is still of interest. Anyway:

1) I would strongly advise to use the pdfx package:

\usepackage[a-1b]{pdfx}

2) The error in the pdfx package is caused by the way how the timestamp is put together. Depending on your timezone (e.g. UTC+1, UTC-1, etc) you have a different sign there. This causes the issue.

Use of \getTZh doesn't match its definition.

You therefore need to put the pdfx.sty in your working directory and need to adjust that specific line accordingly:

\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm} % change - to + if error occurs (due to timezone)

...

T\xHour:\xMin:\xSec+\xTZh:\xTZm}} % change - to + if error occurs (due to timezone)

Alternatively, you may change the timezone of your system.

3) pdfx automatically loads the hyperref package, too. If you want to have a customized hyperref setup, you can use:

\hypersetup{
   unicode,
   colorlinks=true
}

In addition to that, you need to provide a color profile and a valid xmp file. Information on this can be found in the pdfx manual. This solution relies on pdftex.

I'm not aware of any solution using dvips.