0
body {}
.table{
    background-color:aqua
}

这是我保存在本地的 StyleSheet1.cssC:\Users\ingyadav\Documents\Visual Studio 2015\Projects\StyleSheet1.css

<html>
<head>
    <link rel="stylesheet" href="file:///C:/Users/ingyadav/Documents/Visual Studio 2015/Projects/StyleSheet1.css" type="text/css"  />
</head>
<body>
    <table class="table" border="1" style="width:300px;height:500px">
        <tr style="width:auto">
            <td style="width:150px;height:500px"></td>

            <td>
                <table border="1" style="width:150px;height:500px">
                    <tr style="width:auto"><td></td></tr>
                    <tr style="width:auto"><td></td></tr>
                    <tr style="width:auto"><td></td></tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>

这是我现在要加载到 pdf 中的 HTML 字符串

当我将它传递给 evo html 到 pdf 转换器时,它不会将外部 css 加载到 pdf 中。

在 evopdf 支持中,他们提到提供完全限定的 URL,但在使用正确的 URL 后,它也无法加载外部 css。

任何人都可以帮助我吗?

4

1 回答 1

0

不,您不能在href属性中指定多个位置。根据规范,每个都<link>代表一个连接到您的 html 的文档。因此,按照设计,它只是一份文件。

更多示例:https ://www.w3.org/TR/html401/struct/links.html#h-12.3

于 2016-05-23T13:36:57.833 回答