# PDF/A compatibility with TikZ

When a LaTeX document contains TikZ figures with color gradients, it seems that Acrobat Pro's preflight function can no longer convert the PDF to comply with the PDF/A-1b standard.

For instance, the code

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\tikz  \draw [left color=green, right color=blue] (0, 0) rectangle (1, 1);
\end{document}


produces a rectangle with green-to-blue color gradient,

which results in two PDF/A compliance errors ("Syntax problem: real value out of range"), namely "Largest positive real number used: 32768.0" and "Largest negative real number used: -32768.0". The screenshot below indicates that this might be related to a bounding box problem.

At http://www.callassoftware.com/callas/doku.php/en:products:pdftoolbox:all_features:properties is says with respect to "Largest positive real number used" that "In many environments the valid range is limited to the values as defined by IEEE for single-precision floating-point numbers. This limits the range to: +/- 32,767."

Is there a way to fix this problem and to obtain a PDF/A file?

EDIT: When I add a non-unity opacity value to the TikZ \draw options, such as "opacity=0.9999", one of the errors ("Largest positive real number used: 32768.0") disappears.

• Just an idea: PDF/A-1 defaults to PDF 1.3, so it does not support transparency. opacity sounds like it uses transparency features... – Martin Schröder May 20 '14 at 13:20
• I could not recreate these compliance errors, but got a few others for your MWE :) see imgur.com. (Could be due to the old acrobat version?) – Harald Sep 19 '14 at 9:58

Using TeX Live 2014, pdfTeX 3.14159265-2.6-1.40.15, I don't seem to run into these problems. Maybe updating your TeX-system can solve the problems.

Here is a modification of your MWE that embeds a color profile and metadata (I don't have access to Adobe's Preflight tool or other software that can do this in a post-processing step). Information on how to embed this extra data was found in https://tex.stackexchange.com/a/99666 and https://tex.stackexchange.com/a/136653. The color profile can be downloaded from http://www.color.org/srgbprofiles.xalter.

\documentclass{standalone}
\pdfminorversion 4
\immediate\pdfobj stream attr{/N 3} file{sRGB_IEC61966-2-1_black_scaled.icc}
\pdfcatalog{%
/OutputIntents [ <<
/Type /OutputIntent
/S/GTS_PDFA1
/DestOutputProfile \the\pdflastobj\space 0 R
/OutputConditionIdentifier (sRGB IEC61966-2-1 black scaled)
/Info(sRGB IEC61966-2-1 black scaled)
>> ]
}
\usepackage{hyperxmp}
\usepackage[pdftex, pdfa]{hyperref}
\hypersetup{%
pdfauthor          = {a},
pdfkeywords        = {a, b, c},
pdflang            = {en},
pdftitle           = {a},
pdfsubject         = {a},
pdfcaptionwriter   = {a},