HI,
I insert a page break successfully. But now I'm wondering, how to insert a header and footer on all pages. Now I only have the logo on the first page and a footer on the last site.

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Hello Apfel,

Last time I tried to create an header/footer with dompdf, it failed miserably, as it failed to respect the footer area and the content started to be printed on top of it. You can try to reactivate it, search for "print_pdf_dompdf_footer", and uncomment that line. The header would be something similar

It might actually be working in 0.6 now. I tried it only in 0.5.1. If it works for you tell me, so that I might try it also and possibly re-enable that feature.

João

Apfel007’s picture

Hi, I use the 6.2 version and insert the header & footer via php inline into the print.tpl.php. This works really good!

jcnventura’s picture

Title: Footer after page break » dompdf headers and footers

Have to test it with dompdf 0.6 beta 2 then..

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Active
John Sundarraj’s picture

I'm using 0.6.2 beta version of dompdf, any body have idea with headers and footers in all pdf pages

jcnventura’s picture

Status: Active » Closed (won't fix)

There's still no clean way to specify the page margins in dompdf.. Without that, sooner or later the content will spill over the footer or the header.

Anyone interested in this, please ask the dompdf developers to add a function to set the margins of the content area, so that headers and footers can safely be added outside those margins.

antogeorge’s picture

Issue summary: View changes

Please add
body {
# font-family: Arial !important;
margin: 10px 10px 10px 10px !important;
border: 1px solid #000000 !important;
}

this css code for getting margin using dompdf.

antogeorge’s picture

.page {
size: A4 !important;
padding: 30px !important;
padding-top: 100px !important;
padding-bottom: 100px !important;
max-height: 55% !important;
}

.page img
{
max-width: 100% !important;
height: auto !important;
}
.page td img {
max-width: none !important;
}
body {
font-family: Arial !important;
margin: 10px 10px 10px 10px !important;
border: 1px solid #000000 !important;
padding-bottom:30px !important;
padding-top:100px !important;
}
#headerA {
position: fixed;
left: 20px; right: 20px; top: 20px;
text-align: center;
background-color: #FFFFFF;
height: 90px;
}
#headerB {
position: absolute;
left: -20px; right: -20px; top: -200px;
text-align: center;
background-color: #FFFFFF;
height: 190px;
}
#footer {
position: fixed;
left: 20px; right: 20px; bottom: 20px;
text-align: center;
background-color: #FFFFFF;
height: 100px;
bottom: 25px !important;
}
table {
table-layout: fixed !important;
min-width:100%;
max-width:800px !important;
font-family: arial, sans-serif;
border-collapse: collapse;

}

td, th {
border: 1px solid #dddddd;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
html *
{
color: #000000 !important;
}

Please this css for getting header and footer using dompdf library

antogeorge’s picture

Version: 6.x-1.9 » 7.x-1.0-alpha1
Status: Closed (won't fix) » Closed (works as designed)