0

I have working PDF Press generator which uses save_to_pdf method because I need to have a name of generated PDF based on an entry title.

Based on DOMPDF FAQ https://code.google.com/p/dompdf/wiki/FAQ I can add footer/header image to generated PDF, but I'm stuck on which PDF Press file do I need to edit to have accomplish that part?

Thanks

1

After couple back and forth with the add-on developer (more here: http://devot-ee.com/add-ons/support/pdf-press/viewthread/12738) I have got accomplished the goal using a CSS trick from here http://eclecticgeek.com/dompdf/debug.php?identifier=b264f350e6967875987e14faa0c751f0

Template example:

<html>
<head>
  <style>
    @page { margin: 180px 50px; }
    #header { position: fixed; left: 0px; top: -180px; right: 0px; height: 150px; background-color: orange; text-align: center; }
    #footer { position: fixed; left: 0px; bottom: -180px; right: 0px; height: 150px; background-color: lightblue; }
    #footer .page:after { content: counter(page, upper-roman); }
  </style>
<body>
  <div id="header">
    <h1>Widgets Express</h1>
  </div>
  <div id="footer">
    <p class="page">Page </p>
  </div>
  <div id="content">
    <p>the first page</p>
    <p style="page-break-before: always;">the second page</p>
  </div>
</body>
</html>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.