Background
Trying to create a PDF that includes a vectorized cover page having transparent colours. I would like the PDF to have the same appearance in Acrobat Reader, Firefox PDF Viewer, Foxit Reader, and Evince.
Problem
By itself, the PDF cover is identical in Acrobat (left) and Evince (right):
When included using ConTeXt, the PDF cover changes, which also affects the colours on all subsequent pages:
This cover page transparency problem can be resolved with gs
post-processing:
gs -o document-in.pdf -sDEVICE=pdfwrite -dColorConversionStrategy=/sRGB
-dProcessColorModel=/DeviceRGB document-out.pdf
This "fixes" the transparency blending problem on the front page, but then has undesired effects on the remainder of the document (not to mention the file size jumps from 176K to 2.0M, which has negative implications for download times):
In the above example, the colours are likely altered because of the following colour definitions:
\definecolor[ColourSecondary][h=5C883E]
\definespotcolor[ColourSecondaryLighter]
[ColourSecondary][a=1,t=.5]
\definespotcolor[ColourSecondaryLightest]
[ColourSecondary][a=1,t=.2]
When the spot colours are replaced, the problem disappears:
\definecolor[ColourSecondaryLighter][h=adc39e]
\definecolor[ColourSecondaryLightest][h=dee7d8]
However, that then does not produce the transparency effect (the large "S" should allow the horizontal line to show through), although the colours look correct:
On the Windows version of Adobe Acrobat Reader 11, the issues are mostly resolved, but there are artefacts everywhere (along the green side bar, through the large S, and a pattern along the column divider):
While the latter issue appears to be a bug in Adobe Reader (other PDF readers display expected colours), it would be nice to know if there was a way to minimize the effect, given that Adobe Acrobat Reader is the de facto standard PDF viewer on most Windows-based computers.
Source Code
The source code to replicate the problem:
\setupcolors[state=start,]
\definelayer[cover][x=0mm,y=0mm,width=\paperwidth,height=\paperheight,]
\setlayer[cover]{%
\externalfigure[staff-cover.pdf][width=\paperwidth,height=\paperheight]
}
\starttext
\startfrontmatter
\setupbackgrounds[page][background=cover]
\startstandardmakeup
\stopstandardmakeup
\setupbackgrounds[page][background=]
\stopfrontmatter
\startbodymatter
\startchapter[
title={Chapter},
]
\startsection[
title={Section},
]
\stopsection
\stopchapter
\stopbodymatter
\stoptext
Source Files
The source files involved:
- Cover Page (SVG)
- Cover Page (PDF)
Ideas
Commands that did not resolve the issue:
\pdfpageattr{/Group << /S /Transparency /I true /CS /DeviceRGB>>}
\pdfoptionpdfminorversion=4
Question
How do you force ConTeXt to set the correct colour space so that transparency works in Adobe Acrobat Reader 9.x?
Debug Information
Ran:
gs -dBATCH -dNOPAUSE -sDEVICE=tiffsep -dDOINTERPOLATE -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=output.tif -r120 -MaxSeparations=8 document-in.pdf
Output:
GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 23.
Page 1
Page 2
Page 3
Page 4
%%SeparationName: ColourSecondary
Page 5
%%SeparationName: ColourSecondary
...
The SeparationName
items exactly correspond to the pages that have the transparent colour.
Ran:
identify -verbose document-in.pdf > verbose.log
Output (page 0):
Image: document-in.pdf
Format: PDF (Portable Document Format)
Class: DirectClass
Geometry: 612x792+0+0
Resolution: 72x72
Print size: 8.5x11
Units: Undefined
Type: TrueColorMatte
Endianess: Undefined
Colorspace: RGB
Depth: 16/8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
Rendering intent: Undefined
Interlace: None
Background color: white
Border color: rgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Compose: Over
Page geometry: 612x792+0+0
Dispose: Undefined
Iterations: 0
Scene: 0 of 23
Compression: Undefined
Orientation: Undefined
Properties:
date:create: 2013-09-28T20:26:35-07:00
date:modify: 2013-09-28T20:26:35-07:00
pdf:Version: PDF-1.7
signature: 413f2c91258484426000128ea39e439cd701a81658d8e1521a69173b096dc0ed
Profiles:
Profile-icc: 2576 bytes
Artifex Software sRGB ICC Profile
Artifacts:
verbose: true
Output (page 1):
Format: PDF (Portable Document Format)
Class: DirectClass
Geometry: 612x792+0+0
Resolution: 72x72
Print size: 8.5x11
Units: Undefined
Type: PaletteMatte
Endianess: Undefined
Colorspace: RGB
Depth: 16/8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 8-bit
Rendering intent: Undefined
Interlace: None
Background color: white
Border color: rgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Compose: Over
Page geometry: 612x792+0+0
Dispose: Undefined
Iterations: 0
Scene: 1 of 23
Compression: Undefined
Orientation: Undefined
Properties:
date:create: 2013-09-28T20:26:35-07:00
date:modify: 2013-09-28T20:26:35-07:00
pdf:Version: PDF-1.7
signature: 7dacb7c961ec49fea92685440d0cc5a1f1ef61b06c3179bcf1309768e77a79bd
Profiles:
Profile-icc: 2576 bytes
Artifex Software sRGB ICC Profile
Most pages have a 1-bit alpha channel depth and a type of PaletteMatte
. Other pages have a type of TrueColorMatte
. Not sure if that is relevant.
Related
Related TeX.SE questions:
- \includegraphics PDF, color problem
- Multiple PDFs with page group included in a single page warning
- Inkscape → PDF → includegraphics → XeLaTeX → changed colors
- Multiple PDFs with page group included in a single page warning
Related articles, blogs, discussion threads, and wiki pages:
- http://texblog.net/latex-archive/graphics/adobe-reader-wrong-color/
- http://wiki.contextgarden.net/Color
- http://www.mail-archive.com/[email protected]/msg09215.html
- http://sarovar.org/tracker/index.php?func=detail&aid=4326&group_id=106&atid=493
- http://www.latex-community.org/viewtopic.php?f=5&t=1904
- http://tug.org/pipermail/luatex/2012-January/003381.html
- http://wouter.horre.be/doc/latex-beamer-and-colors-in-acrobat-reader
%\pdfpageattr{/Group << /S /Transparency /I true /CS /DeviceRGB>>}
? I thought that was meant to counter-act the transparency bug in acroread.