PDF Template Header/Footer overlap?

Hey guys,

Any idea how I can prevent my header/footer content from overlapping body content? When I set margins, all it does it move that content up, but still overlaps. Not sure what I’m doing wrong.


bump! Any ideas? I’m not sure if I’m experiencing a glitch or if there is a workaround. My body content overlaps header/footer content.

Weird, I haven’t experienced this issue before, what might help would be to edit each section and grab the raw HTML and have a look at that, may have opened up a div and not closed it or something similar somehow.


I have same issue. Body text is just going down, over 1. page footer, and 2. page header, like they don’t exist?
I have checked open/closed div it is all ok.

Any idea what to do? (SuiteCRM version 7.4.3)


this is an old post and old SuiteCRM version, try to upgrade your current version, if you don’t want to, check at your margins setup, margins are the thing to look at.

best regards


margins are the first thing I have tried, second was closing divs. None of that works.
Version may be older but it is stable and functional, but I will try on test instance v.7.6


B) I know this an old topic , I had this problem also and i just fixed the issue in suitecrm 7.8

edit the file: modules/AOS_PDF_Templates/PDF_Lib/config.php
Change Line 186 & 187

$this->setAutoTopMargin = false;	
$this->setAutoBottomMargin = false;


$this->setAutoTopMargin = stretch;	
$this->setAutoBottomMargin = stretch;

also editing the value on line 188 will determine how far from the header items will start

$this->autoMarginPadding = 10;


Do you know maybe, how can I change the left and right margin of the footer and header section separately from the body margin?

Thank you!

Thanks Rasheid,

I have this problem also at 7.9.


Kind of crazy that we are in 7.11.10 and this bug still requires that manual patch

Not crazy, perfectly normal since nobody bothered to provide a patch.

Also, the current fix suggested is inside a 3rd party software, so SuiteCRM can’t really fix it there - either it can be done somewhere else, or it needs to be fixed in the original PDFLib package.

1 Like

I know that this is a really old question(“change the left and right margin of the footer and header section separately from the body margin?”), but this thread shows up in google search results as one of the top results when searching a solution for this. Because of that I would like to provide a quick solution for that for future references:

Just add a negative (-) margin of same amount (as the margin you configured globaly for that template) to the container of your header or footer (do this within the provided html editor, no coding needed):

An example: For this template I configured a margin-left of “15” in the gui. Since my header consists of a full width single image which should be printed without any borders, I add a margin of “-15” px to it. Note: If you do not have a container around your whole footer yet, just insert a new div (or a span tag, or…) manually in html editor and apply the margin to it.

Please also note: The same technique should also work if your header/footer is overlaying the body content. For example just add a margin-top (amount = height of header + your desired margin) to the first element on the 2nd page. If you have “fixed” layouts like me this will work without any problems. If you can’t determine which element will be the first displayed on the 2nd (or 3rd and so on) page, this won’t work for you (or at least you will have to edit the template each time you print a pdf again…).

EDIT: I have to correct myself. After writing this I’ve done a quick test. I don’t know why, but when margin for left border is set to “9” within the gui, I have to use a value of “-34px” to get no white space/borders. I assume that you set the values within the gui in metric units(cm for example) because it is “intended” to use for “real” print scenarios (and when it comes to professional print services they normally measure in metric units) and in css you add a pixel value. This would mean that you would have to calculate (or just try out as I did) the right px amount for your margin value based on dpi/screen resolution . Can anyone confirm or explain this behavior if I’m not right ? I’m just curious what’s going on there.

1 Like


since Version 7.12 is a new PDF Creator used “tcpdf”. There is the same Problem, is there also an fix for this problem?



is there any solutions? This was also an “bug” in the old engine. Would be great if someone could fix this :). I have no idea how to fix it in the config files of tcpdf…

any ideas? Is this Problem known in meanwhile?

I also have this issue since the upgrade to 7.11. Also the tables in invoices are running out of the printed page

1 Like