【发布时间】:2013-05-21 15:09:20
【问题描述】:
我正在尝试使用 bootstrap.css 设置由 grails 渲染插件生成的 pdf 样式。 pdf 生成良好,但没有应用任何 css 样式。
过去几天一直在寻找这个问题的答案,但一无所获。
css background is not working when convert template into pdf using rendering plugin
Grails rendering plugin css issue
所有答案都表明解决方案是确保 grails.serverURL 在 Config groovy 中正确设置。
目前在以安全模式运行的开发机器上运行,因此我设置了 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>
任何建议将不胜感激。
【问题讨论】:
标签: css grails twitter-bootstrap rendering