I am trying to use bootstrap.css to style a pdf that is being generated by the grails rendering plugin. The pdf is generated fine but none of the css styling is being applied.
Have been searching for an answer to this for the past couple of days and am getting nowhere.
css background is not working when convert template into pdf using rendering plugin
Grails rendering plugin css issue
All the answers suggest that the solution is to make sure grails.serverURL is set correctly in Config groovy.
Currently running on development machine running in secure mode so I have set grails.serverURL="https://localhost:8443/"
and have also tried different variations of this.
Template code for .gsp
file is as follows:
<!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>
Any suggestions would be greatly appreciated.