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

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


doc中所述,但pdf内容周围始终有白色/空白框。
客户希望他的背景覆盖整个pdf文件以及该白色/空白空间内的折叠标记。
对我来说,grails renderingservice似乎为可能不可打印的区域保留了一些空间。我如何“打印”到该区域?
我在文档中没有找到任何内容,而Google也无济于事。

最佳答案

解决方案是:

<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/

10-12 07:12