Forum Bugs

A couple of issues with box-shadow

David J Prokopetz
I've bumped into a couple of issues with the box-shadow CSS property, one of which is definitely either a bug or an oversight, and one of which arguably is not:

1. Prince seems to rasterise box shadows, yet the --raster-dpi command line flag does not appear to apply to them. In fact, I can't seem to find any way to affect their resolution at all.

2. The way Prince is aligning rendered box shadows with the elements they're applied to produces a visible hairline at some zoom levels when there's high contrast between the background and the associated box, at least in every PDF viewer I've tried; minimal example attached.
  1. block-with-gap.png0.4 kB
  2. box-shadow-test.html0.2 kB
  3. box-shadow-test.pdf5.2 kB

Edited by David J Prokopetz

wangp
The resolution can be controlled with the prince-filter-resolution property, e.g.
img { prince-filter-resolution: 300dpi }


Maybe there's something we can do about the hairline, not sure yet. I think I only see it with Firefox (PDF.js) which has a behaviour where, a short while after zooming, images snap into slightly different positions, presumably to the nearest integer coordinate or something to avoid bluriness. Which PDF viewers are you seeing the hairline with?

Edited by wangp