Forum How do I...?

Box overlap (possibly Acrobat sucking and failing)

StoneCypher
Boxes appear to have background overlap. This is toxic to elements which have semi-transparent backgrounds. Consider this code, which should generate a solid field of blue:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

  <head>
    <style type="text/css">

      p { background-color: rgba(0,0,255, 0.5); margin: 0; padding: 0; border: 0; line-height: 100%; }

    </style>
  </head>

  <body>

    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>
    <p>Table of Contents</p>

  </body>

</html>


Similar problems are exhibited with other display types - I originally faced this on list items, and this also reproduces on table cells (horiz and vert) when border-collapse is set.

Notably, there's a graphics library called Anti-Grain Geometry which has SVG examples using this effect to show Acrobat making bad rendering decisions on datasets where other renderers make different sets of mistakes; this may actually be a defect in Acrobat, rather than in Prince. At this time I do not have sufficient information to tell.

More troublingly, what I actually care about is how this is rendered at the printer, and at this time I have no information on what CreateSpace's renderer does with this.

Do you see a natural fix? I do not.

John Haugeland is http://fullof.bs/

StoneCypher
Sorry, forgot to attach the problem screenshots.

The problem seems to be infinitely small - even zoomed into Acrobat's max 6400%, it's only one pixel h/v.

Could this be either a fencepost error, the region equivalent of a miter/cap/join problem, etc? It can't be a region merge, because then two differently-colored alpha backgrounds would exhibit a single pixel blend region undesirably.

John Haugeland is http://fullof.bs/

  1. bgOverlap.png95.0 kB
  2. bgOverlap2.png83.3 kB
mikeday
Infinitely small overlap is definitely a rendering issue. The only way to fix it is to avoid those kind of joins with translucent backgrounds, or use a different PDF renderer.