Welcome Guest Search | Active Topics | Sign In | Register

CSS text shadow missing Options
lostfish
Posted: Thursday, July 20, 2017 11:46:20 AM
Rank: Member
Groups: Member

Joined: 6/7/2017
Posts: 13
Hi,

I have an issue where I can't get css text-shadow to render, I've tried to make the simplest possible example at the bottom of this file.

I'm using version 17.2.0 of EO.Pdf

Hopefully you can help?

Kind regards


somefile.ashx

Code: C#
<%@ WebHandler Language="C#" Class="GenericHandler1" %>
using System;
using System.Web;
using System.IO;
using EO.Pdf;
public class GenericHandler1 : IHttpHandler
{
    HttpContext c;
    public void ProcessRequest(HttpContext context)
    {
        c = context;

        var options = new HtmlToPdfOptions();
        options.TriggerMode = HtmlToPdfTriggerMode.Auto;
        var html = @"&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;style&gt;
        h1 {
            font-size: 100px;
            text-shadow: 10px 10px #0f0;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;shadow?&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;
";

        var doc = new PdfDocument();
        HtmlToPdf.ConvertHtml(html, doc, options);

        var memoryStream = new MemoryStream();
        doc.Save(memoryStream);
        var bytes = memoryStream.ToArray();

        c.Response.AddHeader("Content-Type", "application/pdf");

        c.Response.AddHeader("Content-Disposition", String.Format("attachment; filename=" + "shadow" + ".pdf; size={0}", bytes.Length.ToString()));

        c.Response.BinaryWrite(bytes);

        c.Response.End();

    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}

eo_support
Posted: Thursday, July 20, 2017 4:51:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

This is not currently supported. We will look into it to see if we can support it.

Thanks!
lostfish
Posted: Friday, July 21, 2017 1:44:29 AM
Rank: Member
Groups: Member

Joined: 6/7/2017
Posts: 13
eo_support
Posted: Friday, July 21, 2017 7:33:12 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
No. From EO.Pdf 2016 we switched to the Chromium browser engine for HTML rendering. Older versions use WebKit based browser engine, which does support text shadow. The new Chromium browser engine does not render shadow when printing (you can see that by print-preview the same HTML in Google Chrome browser and you will see shadow is missing as well). It does render shadow when displaying HTML on the screen. So we will see if we can enable the same behavior when printing.
lostfish
Posted: Friday, July 21, 2017 7:36:49 AM
Rank: Member
Groups: Member

Joined: 6/7/2017
Posts: 13
Great! thanks for the explanation!

I didn't realize you were using "print" mode to render, but I guess that does make very good sense.
lostfish
Posted: Tuesday, July 25, 2017 1:45:32 AM
Rank: Member
Groups: Member

Joined: 6/7/2017
Posts: 13
found that the following html will show text shadow in print preview in chrome, but it still doesn't appear in the pdf, maybe that's helpful in getting it to work (maybe not)

pieced together from here: https://stackoverflow.com/questions/13975198/text-shadow-and-box-shadow-while-printing-chrome

Code: HTML/ASPX
<!DOCTYPE html>
<html>
<head>
    <style>
        h1 {
            font-size: 100px;
            text-shadow: 10px 10px #0f0;
        }
        @media print {
            h1 {
                -webkit-print-color-adjust: exact;
                -webkit-filter: drop-shadow(10px 10px 1px #0f0);
            }
        }
    </style>
</head>
<body>
    <h1>shadow?</h1>
</body>
</html>
eo_support
Posted: Tuesday, July 25, 2017 9:37:43 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

This might be an issue related to the version of Chromium browser engine we use. We will look into it and get back to you as soon as possible.

Thanks!
eo_support
Posted: Monday, July 31, 2017 3:55:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

We have confirmed this to be an issue in the Chromium browser engine we use. This issue should be resolved when we update our product to a newer version of the browser engine around the end of this year.

Thanks!
lostfish
Posted: Tuesday, August 1, 2017 1:48:00 AM
Rank: Member
Groups: Member

Joined: 6/7/2017
Posts: 13
Thanks for the update, sounds good!


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.