Closed (works as designed)
Project:
Printer, email and PDF versions
Version:
7.x-1.0-alpha1
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Oct 2011 at 22:34 UTC
Updated:
25 Jun 2019 at 08:44 UTC
Jump to comment: Most recent
Comments
Comment #1
jcnventuraHello 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
Comment #2
Apfel007 commentedHi, I use the 6.2 version and insert the header & footer via php inline into the print.tpl.php. This works really good!
Comment #3
jcnventuraHave to test it with dompdf 0.6 beta 2 then..
Comment #4
jcnventuraComment #5
John Sundarraj commentedI'm using 0.6.2 beta version of dompdf, any body have idea with headers and footers in all pdf pages
Comment #6
jcnventuraThere'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.
Comment #7
antogeorge commentedPlease 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.
Comment #8
antogeorge commented.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
Comment #9
antogeorge commented