[Skip to main content](#vessel-content)

#   Background image for attachinvoice plugin

##

- **[caveman\_d](/forum/user/32977-caveman-d "View caveman&#95;d's Profile")**
- [![caveman&#95;d's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32977-caveman-d "View caveman&#95;d's Profile") Topic Author
- [ Offline](/forum/user/32977-caveman-d)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 7 months ago [\#194724](#194724) by [caveman\_d](/forum/user/32977-caveman-d "View caveman&#95;d's Profile")  *[Background image for attachinvoice plugin](/forum/25-install-update/875670-background-image-for-attachinvoice-plugin#194724 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.0 -- PHP version -- : 5.4  I have the attachinvoice plugin for hika shop 2.4.0 installed and i need to put a background image into the pdf which is as big as the whole page for a specific invoice look.  how can I do this in the invoice.php file of the attachinvoice plugin?")* was created by *[caveman\_d](/forum/user/32977-caveman-d "View caveman&#95;d's Profile")*

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.4

I have the attachinvoice plugin for hika shop 2.4.0 installed and i need to put a background image into the pdf which is as big as the whole page for a specific invoice look.

how can I do this in the invoice.php file of the attachinvoice plugin?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NTY3MC1iYWNrZ3JvdW5kLWltYWdlLWZvci1hdHRhY2hpbnZvaWNlLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 7 months ago [\#194728](#194728) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Background image for attachinvoice plugin](/forum/25-install-update/875670-background-image-for-attachinvoice-plugin#194728 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.0 -- PHP version -- : 5.4  I have the attachinvoice plugin for hika shop 2.4.0 installed and i need to put a background image into the pdf which is as big as the whole page for a specific invoice look.  how can I do this in the invoice.php file of the attachinvoice plugin?")*

Hi,

The plugin is using the library "html2pdf" which transform an HTML page into a PDF file.
So if you want to put a background image, the best will be to edit the HTML to put that background image.
You have to know that "html2pdf" understand the CSS "background-image" rule, you just put an image url that your server will be able to understand/read/access.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NTY3MC1iYWNrZ3JvdW5kLWltYWdlLWZvci1hdHRhY2hpbnZvaWNlLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[caveman\_d](/forum/user/32977-caveman-d "View caveman&#95;d's Profile")**
- [![caveman&#95;d's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32977-caveman-d "View caveman&#95;d's Profile") Topic Author
- [ Offline](/forum/user/32977-caveman-d)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 7 months ago -  11 years 7 months ago [\#194781](#194781) by [caveman\_d](/forum/user/32977-caveman-d "View caveman&#95;d's Profile")  Replied by *[caveman\_d](/forum/user/32977-caveman-d "View caveman&#95;d's Profile")* on topic *[Background image for attachinvoice plugin](/forum/25-install-update/875670-background-image-for-attachinvoice-plugin#194781 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.0 -- PHP version -- : 5.4  I have the attachinvoice plugin for hika shop 2.4.0 installed and i need to put a background image into the pdf which is as big as the whole page for a specific invoice look.  how can I do this in the invoice.php file of the attachinvoice plugin?")*

But where in the code do I have to put it in?

When I modify the style section of the invoice.php the image isn't shown in the pdf. Here is the code I'm using:
Code:

&lt;style type="text/css"&gt; &lt;!-- .invoicetitle{ text-align:center;font-size:30px; padding-top:40px;padding-bottom:40px} legend { padding:5px 10px; background-color:#5471B5;color:white;font-weight:bold;border-color:#ccc} fieldset { padding:10px; border-color:#ccc;} div.date{text-align:right;color:#333;} .storeaddress{ color:#333; } .addresses{padding-top:50px;} .addresses td{padding-left:50px;} .addresses fieldset {float:left;} table.products{margin:auto;margin-top:60px;width:580px;border-collapse:collapse} .price{text-align:center;} .products td, .products th{border:1px solid #ccc;padding:7px 4px;} .products th{background-color:#5471B5;color:white;} td.newarea{text-align:right;padding-right:20px;} tr.total{font-weight:bold;} .products tr.limitation td{background-color:#ccc;padding:1px 0px;} .hikashop_order_custom_fields_fieldset{margin-top : 20px;} .footer{ font-size:10px;color:#aaa;text-align:center;} body {background-image: url(http://youtube-filme.de/a4.jpg);} --&gt; &lt;/style&gt;

Last edit: 11 years 7 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: [code] is nice !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NTY3MC1iYWNrZ3JvdW5kLWltYWdlLWZvci1hdHRhY2hpbnZvaWNlLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14269
-
-

11 years 7 months ago [\#194816](#194816) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Background image for attachinvoice plugin](/forum/25-install-update/875670-background-image-for-attachinvoice-plugin#194816 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.0 -- PHP version -- : 5.4  I have the attachinvoice plugin for hika shop 2.4.0 installed and i need to put a background image into the pdf which is as big as the whole page for a specific invoice look.  how can I do this in the invoice.php file of the attachinvoice plugin?")*

Hi,

Your issue is with your CSS. If you look at the HTML of the invoice below the style section, there is no "body" tag so the image is not taken into account.
Instead, you probably want to try on the "page" tag like this:
page {background-image: url([ youtube-filme.de/a4.jpg](http://youtube-filme.de/a4.jpg));}
Now that might not work as page is a specific tag of the HTML2PDF library.
You might want instead to have a div tag inside the page tag which would be around all the page in order to apply the image background on the div.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NTY3MC1iYWNrZ3JvdW5kLWltYWdlLWZvci1hdHRhY2hpbnZvaWNlLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.204 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
