Hello
I want to place an image full width at the bottom of my pages in my invoice. How can I do this? I tried using an img block, but position absolute does not work, and also just adding it into the HTML gives me white margins (because of the margins definced in the TCPDF). Can I use TCPDF commands to add a footer and image?
Ok I found a file in the helper folder of Virtuemart component. There is a header section:
// get the current page break margin
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0);
// set bacground image
$img_file = K_PATH_IMAGES.'bg-footer.jpg';
$this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
// restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$this->setPageMark();
I added this so it adds a full page background: https://tcpdf.org/examples/example_051/
But it's not working. Anyone has an idea why not?
Can I change the topic to General questions, hoping someone could help me there?
I gave up trying to have a background image with tcpdf...
In the end I set all margins to 0
added an image in a table .. again all margins and paddings 0
then the rest of the invoice with tables and tds
td width="10%"
td width="80%" // this contains all the sub templates
td width="10%"
Don't know how u will get the image to the footer though .. I found a lot of the TCPDF code snippets simply didn't work for me in the helper
The above way at least avoids core change
Quote from: GJC Web Design on March 20, 2020, 11:16:57 AM
I gave up trying to have a background image with tcpdf...
In the end I set all margins to 0
added an image in a table .. again all margins and paddings 0
then the rest of the invoice with tables and tds
td width="10%"
td width="80%" // this contains all the sub templates
td width="10%"
Don't know how u will get the image to the footer though .. I found a lot of the TCPDF code snippets simply didn't work for me in the helper
The above way at least avoids core change
Hmm, maybe I should give this a try. Thanks for replying.
The easiest way to achieve this will be to get pre printed invoice paper with the header and footer done already.
clever boy.... :)
except I never waste a tree and print mine.. ;)
Quote from: GJC Web Design on March 26, 2020, 10:53:20 AM
clever boy.... :)
except I never waste a tree and print mine.. ;)
True, me not too. ;-)