我想使用bootstrap.css来设计由grails呈现插件生成的pdf样式。生成的PDF很好,但没有任何CSS样式正在应用。包括外部css grails呈现插件问题
过去几天一直在寻找这个问题的答案,我正在变得无处可寻。
css background is not working when convert template into pdf using rendering plugin
Grails rendering plugin css issue
所有的答案表明,该解决方案是确保grails.serverURL在配置常规设置正确。
当前在安全模式下运行的开发机器上运行,所以我设置了grails.serverURL="https://localhost:8443/"
,并尝试过不同的变化。为.gsp
文件
模板代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Invoice</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
@page {
size: A4 landscape;
}
</style>
<link rel="stylesheet" href="${resource(dir: 'css', file: 'bootstrap.css')}"/>
<r:layoutResources/>
</head>
<body>
<div class="content">
<div class="well">
<p class="pull-right">Invoice: ${companyName.encodeAsHTML()}</p></div></div>
<r:layoutResources/>
</body>
</html>
任何建议,将不胜感激。
嗨Saurabh内联css工作,但我需要使用bootstrap中提供的格式很多,所以这不是我真正的选择。谢谢回复。 –