14

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):

Cover Page PDF

When included using ConTeXt, the PDF cover changes, which also affects the colours on all subsequent pages:

Cover Page Embedded

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):

Example Document Page, Incorrect Colour Space?

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:

Example Document Page, No Transparency

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):

Example Document Page, Acrobat Reader 11

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:

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:

Related articles, blogs, discussion threads, and wiki pages:

2
  • 1
    What happens when you use the same image with LuaLaTeX and LaTeX? That will help in isolating whether it is a macro package bug, engine bug, or a reader bug. I remember similar questions being asked in the past, and the conclusion was that it was a known bug in Adobe Reader.
    – Aditya
    Sep 29, 2013 at 0:38
  • 2
    what happens if you uncomment %\pdfpageattr{/Group << /S /Transparency /I true /CS /DeviceRGB>>} ? I thought that was meant to counter-act the transparency bug in acroread. Sep 29, 2013 at 1:53

1 Answer 1

9

From the ConTeXt Mailing List:

\setupcolors[pagecolormodel=auto]

In Acrobat, when transparency is used, a different route is followed (at least in the past) when rendering. Rendering colorspaces might be adapted to the output medium so it's a combination of colorspace, monitor/paper, calibration, knockout/overprint, transparency groups, assumptions, and so forth.

You must log in to answer this question.

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