完全不支持itext7.pdfhtml中的CSS属性

问题描述

我正在使用itext7.pdfHtml附加组件将html模板转换为PDF doc,并且一切正常,结果生成没有任何错误,但是我发现有一堆无法用pdfhtml dll识别的CSS属性。 。 其中一些属性显示在此代码段中:

.day-meta-wrapper {
    font-size: 15px;
    line-height: normal;
    height: 24px;
    border-radius: 12px;
    color: #ffffff;
    background: #00000033;----> not support
    padding: 0 6px;
    display: flex;----> not support
    align-items: center;----> not support
    justify-content: center;----> not support
}

这是我的html文件结果:

enter image description here

正如您在浏览器视图中看到的那样,没有问题,并且所有属性均正常运行 但这是我的PDF结果:

enter image description here

如图PDF文档所示,失去了CSS属性

h1 {
    background-color: red;
}

.day-meta {
    margin: 5px 0;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-meta-wrapper {
    font-size: 15px;
    line-height: normal;
    height: 24px;
    border-radius: 12px;
    color: #ffffff;
    background-color: #00000033;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>Document</title>

    <link rel="stylesheet" href="css/DayMeta.css">
</head>
<body style="background: #979797;">
    <h1>Hello IText7 PDFHtml</h1>
    <div class="day-meta">
        <div class="day-meta-wrapper">
            <div>December 11,2018</div>
        </div>
    </div>
</body>
</html>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...