简体   繁体   English

如何使用 python (django with pisa) 在 pdf 中设置页脚

[英]how to set footer in pdf using python (django with pisa)

I tried to set footer on first page only by using pisa official documentation but it comes in all pages so please suggest how to apply footer on first page of pdf我尝试仅通过使用比萨官方文档在第一页上设置页脚,但它出现在所有页面中,所以请建议如何在 pdf 的第一页上应用页脚

Kind of code goes like this代码是这样的

<head>
   <style>
       @page {
            size: a4 portrait;
            @frame header_frame {           /* Static Frame */
               -pdf-frame-content: header_content;
               left: 50pt; width: 512pt; top: 50pt; height: 40pt;
            }
            @frame content_frame {          /* Content Frame */
                left: 50pt; width: 512pt; top: 90pt; height: 632pt;
            }
            @frame footer_frame {           /* Another static Frame */
                -pdf-frame-content: footer_content;
                left: 50pt; width: 512pt; top: 772pt; height: 20pt;
            }
      }
  </style>
</head>

<body>
  <!-- Content for Static Frame 'header_frame' -->
  <div id="header_content">
    <h3>Company</h3>
  </div>

  <!-- Content for Static Frame 'footer_frame' -->
  <div id="footer_content">(c) - page <pdf:pagenumber>
    of <pdf:pagecount>
  </div>
</body>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM