News:

Looking for documentation? Take a look on our wiki

Main Menu

Image in footer invoice

Started by Kuubs, March 04, 2020, 08:34:16 AM

Previous topic - Next topic

Kuubs

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?

Kuubs

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?

Kuubs

Can I change the topic to General questions, hoping someone could help me there?

GJC Web Design

#3
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

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Kuubs

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.

StefanSTS

The easiest way to achieve this will be to get pre printed invoice paper with the header and footer done already.
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

GJC Web Design

clever boy....  :)

except I never waste a tree and print mine..  ;)
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

StefanSTS

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. ;-)
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.