Thursday, May 25, 2017

Basic layout of Dompdf

<html>
<head>
  <style>
  @page { margin: 50px; }
.header,
.footer {
    width: 100%;
    position: fixed;
}
.header {
    top: -50px;
    height:50px;
}
.footer {
    bottom: -50px;
    height:50px;
}
.pagenum:before {
    content: counter(page);
}
  </style>
  </head>
<body>
<div class="header">
    <div style="border-bottom:1px solid #ccc000;">Ubed Khan Web Developer&#0169;</div>
</div>
<div class="footer">
    <div style="border-bottom:1px solid #ccc000;">Copyright &#0169; 2017 ukphpdeveloper.blobspot.in. All Right Reserved.</div>
</div>
<div class="content">
//here your pdf page content will placed
you can use page break style as below when you want your content on next page of pdf.
 <!--<p style="page-break-before: always;"><a href="ukphpdeveloper.blogspot.in">ukphpdeveloper.blogspot.in</a></p>-->
</div>
</body>
</html>

Dompdf with cakephp

No comments:

Post a Comment