css - 如何使用 grails 渲染服务打印折叠标记?

标签 css pdf grails rendering

客户希望在生成的 pdf 中包含折叠标记和重复的背景图像。我试过了

<style  type="text/css">
 @page {
   size: 210mm 297mm;
 }
</style>

doc 中所述,但 pdf 内容周围始终有一个白色/空白框。 客户希望他的背景延伸到整个 pdf 和这个白色/空白空间内的折叠标记。 对我来说,grails renderingservice 似乎为可能不可打印的区域保留了一些空间。我怎样才能“打印”到那个区域? 我在文档中找不到任何内容,谷歌也无济于事。

最佳答案

解决方案是:

<html>
<head>
  <title>...</title>
  <style type="text/css">
    @page {
      size: 210mm 297mm;
      margin: 0
    }
  </style>
 </head>
 <body>
   <div style="float:left">
     <div style="height:2px;width:6px;margin-top: 105mm; left:0;background-color: black"></div>
     <div style="height:2px;width:6px;margin-top: 105mm; left:0;background-color: black">   </div>
   </div>
   <div><!-- content here --></div>
   <div style="page-break-after:always;"></div>
 </body>
 </html>

但这引出了下一个问题:如何以通用的方式在每一页上重复折叠标记?

关于css - 如何使用 grails 渲染服务打印折叠标记?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21548008/

相关文章:

java - 将具有可编辑字段的 pdf 转换为 html

swift - 使用 swift 代码从文件系统打开 pdf 文件

html - 无法在字段集顶部留出 <legend>

css - 无法让 CSS 在同一级别制作元素

css - 最小 vh 值(CSS)?

mysql - 查询的 Grails HQL 表示

inheritance - Grails/GORM:继承的域类的行为不一致(测试VS Bootstrap)

html - <td> 上的溢出属性不会创建滚动条

c# - 使用 iTextSharp 填写 PDF 表格并通过电子邮件发送填写好的表格

database - 排序前的Grails映射值