Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to make PDF/A from LaTeX (not from LuaTeX etc.) with TeX Live 2013 on Fedora Linux. This works:

\documentclass{article}

\begin{document}

What cat says? \label{meow}

See question on page \pageref{meow}.

\end{document}

With commands latex, dvips and last

gs -dPDFA -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor
-sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite
-sOutputFile=meow.pdf meow.ps

Now, when I add \usepackage[pdfa]{hyperref} I got validation errors like

dc:description :: Wrong value type. Expected type 'lang alt'.
The XMP property 'dc:title' is not synchronized with the document
information entry 'Title'.
A device-specific color space (Annotation C or IC) without an
appropriate output intent is used.

Documentation of hyperref says

-- result is usually not in PDF/A, because many features aren't controlled by hyperref --

but how to control those?

Should I even try this path? There are alternatives like pdfx. Which path to use?

share|improve this question
    
If you want a PDF why not using pdflatex? Using pdflatex I got no error. –  Raniere Silva Aug 26 '13 at 16:02
    
Yes, you get PDF but not PDF/A with pdflatex. –  Jori Mäntysalo Aug 26 '13 at 16:34
2  
Doesn't tex.stackexchange.com/questions/576/… help? –  You Aug 26 '13 at 19:20
    
I have read that about pdfx, but didn't figure out how to make it work. Some kind on Hello world -example would be nice. –  Jori Mäntysalo Aug 27 '13 at 5:41

1 Answer 1

up vote 25 down vote accepted
+50
  1. Put the color profile eciRGB_v2.icc in the working directory.
  2. Add the flowing code to your preamble:
\pdfminorversion 4
\immediate\pdfobj stream attr{/N 3}  file{eciRGB_v2.icc}
\pdfcatalog{%
/OutputIntents [ <<
/Type /OutputIntent
/S/GTS_PDFA1
/DestOutputProfile \the\pdflastobj\space 0 R
/OutputConditionIdentifier (eciRGB v2)
/Info(eciRGB v2)
>> ]
}
  1. Add metadata with hyperxmpand \hypersetup:

Load hyperxmp:

\usepackage{hyperxmp}

Add metadata in \hypersetup:

\hypersetup{%
       pdftitle={Title},
       pdfauthor={Author},
       pdfauthortitle={Title of the Author},
       pdfcopyright={Copyright (C) 20xx, Copyrightholder},
       pdfsubject={Something},
       pdfkeywords={Keyword1, Keyword2},
       pdflicenseurl={http://creativecommons.org/licenses/by-nc-nd/3.0/},
       pdfcaptionwriter={Scott Pakin},
       pdfcontactaddress={Street},
       pdfcontactcity={City},
       pdfcontactpostcode={101},
       pdfcontactcountry={Country},
       pdfcontactemail={email@institute.edu},
       pdfcontacturl={http://www.institute.edu},
       pdflang={en},
       bookmarksopen=true,
       bookmarksopenlevel=3,
       hypertexnames=false,
       linktocpage=true,
       plainpages=false,
       breaklinks
     }

Everything put together results in a document like this:

% ===============================
% Filename: test.tex

\documentclass{article}

% ===============================
% Embedding the color profile.
% Requires eciRGB_v2.icc in the working directory
% http://www.eci.org/_media/downloads/icc_profiles_from_eci/ecirgbv20.zip


\pdfminorversion 4
\immediate\pdfobj stream attr{/N 3}  file{eciRGB_v2.icc}
\pdfcatalog{%
/OutputIntents [ <<
/Type /OutputIntent
/S/GTS_PDFA1
/DestOutputProfile \the\pdflastobj\space 0 R
/OutputConditionIdentifier (eciRGB v2)
/Info(eciRGB v2)
>> ]
}

\usepackage{xcolor}
\usepackage{hyperxmp}
\usepackage[pdftex, pdfa, linktoc=none]{hyperref}

% ----------------------------------------------
% Add metadata

\hypersetup{%
       pdftitle={Title},
       pdfauthor={Author},
       pdfauthortitle={Title of the Author},
       pdfcopyright={Copyright (C) 20xx, Copyrightholder},
       pdfsubject={Something},
       pdfkeywords={Keyword1, Keyword2},
       pdflicenseurl={http://creativecommons.org/licenses/by-nc-nd/3.0/},
       pdfcaptionwriter={Scott Pakin},
       pdfcontactaddress={Street},
       pdfcontactcity={City},
       pdfcontactpostcode={101},
       pdfcontactcountry={Country},
       pdfcontactemail={email@institute.edu},
       pdfcontacturl={http://www.institute.edu},
       pdflang={en},
       bookmarksopen=true,
       bookmarksopenlevel=3,
       hypertexnames=false,
       linktocpage=true,
       plainpages=false,
       breaklinks
     }

\begin{document}
What cat says? \label{meow}
See question on page \pageref{meow}.
\end{document}

Which is PDF/A-1b compliant:

Result of online pdf-validation tool

This works only with pdfLaTeX and LuaLatTeX.

share|improve this answer
    
Thanks, now we are close to solution. However, I guess that you mean "compile with latex", not with pdflatex. Also, I still got complains like "The XMP property 'dc:description' is not synchronized with the document information entry 'Subject'." –  Jori Mäntysalo Oct 7 '13 at 12:54
    
Well, LaTeX + dvips won’t work with ghostscript (only Adobe Distiller), so you have to resort to Dvipdfm instead of dvips. –  DG' Oct 7 '13 at 14:34
    
dvipdfm gives plenty of warnings, but produces .pdf anyway. But result file has no hyperlinks. gs on my system won't work if input and output files are same. –  Jori Mäntysalo Oct 8 '13 at 5:56
    
There is, as far as I can see, no good solution for working hyperlinks with your setup. You should really consider using pdflatex instead of plain latex. –  DG' Oct 8 '13 at 8:38
    
If I start with your example, I get no hyperlinks at all. So, I remove draft-option, and get PDF with hyperlinks. And then, when I use gs-command to PDF, I got PDF that is almost PDF/A, but not exactly; see for example dc:description -error above. –  Jori Mäntysalo Oct 9 '13 at 11:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.