|
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 = @"<!DOCTYPE html>
<html>
<head>
<style>
h1 {
font-size: 100px;
text-shadow: 10px 10px #0f0;
}
</style>
</head>
<body>
<h1>shadow?</h1>
</body>
</html>
";
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;
}
}
}
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Hi,
This is not currently supported. We will look into it to see if we can support it.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 6/7/2017 Posts: 13
|
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
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.
|
|
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.
|
|
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>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
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!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
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!
|
|
Rank: Member Groups: Member
Joined: 6/7/2017 Posts: 13
|
Thanks for the update, sounds good!
|
|