Welcome Guest Search | Active Topics | Sign In | Register

rgba() text-shadow color causes random portions of text to rasterize Options
jblplatinum
Posted: Sunday, June 22, 2014 10:52:54 PM
Rank: Newbie
Groups: Member

Joined: 6/19/2014
Posts: 5
This sample HTML code produces an output PDF where random portions of the text are output as an image. The text is still selectable, but the visual quality is poor.

This is a huge pain, as in more complex documents random small portions of the text with no text-shadow applied will become rasterized, producing a very poor looking document.

I narrowed the problematic CSS down to a text-shadow clause. Replace the rgba() with a solid color, and the output is fine.

See the output PDF here: https://dl.dropboxusercontent.com/u/43207753/output.pdf

Code: HTML/ASPX
<html>
    <head>
        <style type="text/css">
            div.shadow {
                text-shadow: 1px 1px 0 rgba(255,0,0,0.5);
            }
            div {
                padding-bottom:20px;
            }
            div.floatleft {
                width: 200px;
                float: left;
                border: 1px solid black;
                padding: 20px;
                margin-right: 20px;
            }
        </style>
    </head>
    <body>
        <div class="floatleft">
            No shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow
        </div>
        <div>
            No shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow
        </div>
        <div>
            No shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow
        </div>
        <div>
            No shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow
        </div>
        <div class="shadow">
            Shadow
        </div>
        <div>
            No shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow
        </div>
        <div>
            No shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow
        </div>
        <div>
            No shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow
        </div>
        <div class="shadow">
            Shadow
        </div>
        <div>
            No shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow
        </div>
        <div>
            No shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow no shadow
        </div>
    </body>
</html>


Note to other people with the same problem: we were able to work around this in our site by adding the following to our print CSS:
Code: HTML/ASPX
* {
    text-shadow: none !important;
}
*:before {
    text-shadow: none !important;
}
*:after {
    text-shadow: none !important;
}
eo_support
Posted: Sunday, June 22, 2014 11:13:27 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Yes. Shadow will always cause contents to be rasterized. And I think your workaround is a great workaround. Thanks for sharing!
jblplatinum
Posted: Sunday, June 22, 2014 11:19:59 PM
Rank: Newbie
Groups: Member

Joined: 6/19/2014
Posts: 5
Thanks for your reply

Is there a Release Notes document or similar where I can find out about these (and other known) issues so next time I don't need to spend time debugging?

The shadow is clearly not rasterizing correctly and is badly affecting large unrelated portions of the document. If the bug is in upstream webkit it could be an idea to preprocess the CSS in the EO codebase to remove instances of text-shadow before rendering.

eo_support
Posted: Monday, June 23, 2014 9:50:47 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Thank you very much for your valuable feedback. Preprocess CSS in EO to filtering out text-shadow is an interesting thought worth exploring. We will see what we can do.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.