Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
7 Trả lời
56946 Lượt xem

I am generating a QWeb/Report with the following css rule:

.table-condensed {background-image:url('/l10n_ar_report_invoice/static/invoice_back.png');

and I see it correctly while printing the report in html. But when I set the report as PDF report the image is not shown.

Is there any way see a background-image in the pdf generated by QWeb/Report?

Ảnh đại diện
Huỷ bỏ

Have you managed to do this?

I think your image url might be wrong..

Hi Damian: I am facing the same issue.. Did you get any solution for this?

Câu trả lời hay nhất

Odoo13 still same problem for multipage report

Anyway, this is a working solution using position absolute and z-index attributes





< div class="page" style="position:relative;">
< img src="/your_module/static/src/img/bg.png" style="position: absolute;
left:0;
top:0;
transform: translate(-50%,-50%);
z-index:-10;
width: 100%;
height: 100%; "/> .....



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Wkhtmltopdf cannot render png or gif images as backgrounds. Try converting your background image to a jpg.

EXAMPLE:

<div class="page" t-attf-style="background-image:url('/my_module/static/img/wzor.jpg'); background-size:195mm 282mm; width:195mm; height:282mm;"> 
Ảnh đại diện
Huỷ bỏ

I am using jpg image but still the same, the image is only shown in html report and can not be shown in PDF report.

In my system works ok?! May try to update wkhtmltopdf.

Câu trả lời hay nhất

Wkhtmltopdf can render png,gif or jpg images as backgrounds.

using the syntax with 5 or more so lines.
<table class="table table-condensed" style="background-image:url('http://fc08.deviantart.net/fs70/i/2011/179/f/a/balloons_stock_2_png_by_mysticmorning-d3kds2w.png');">  


<table class="table table-condensed" style="background-image:url('http://upload.wikimedia.org/wikipedia/en/b/bc/Torus_with_cross-hatched_wireframe.gif');">

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I have faced a same problem and the problem was due to the background CSS shorthand rule (background: ....). So when i separate it to the generic CSS rules (background-image & background-position etc ..) the image has appeared correctly.


Note: I was using a png background.


Hope that helps!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Did anyone find the solution ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Did any of you find a solution on this ? I have the same issue with jpg image showing on html but not on pdf report.

Ảnh đại diện
Huỷ bỏ

Same issue.. Any solution?

Hi, 
we solved the problem by upgrading the wkhtmltopdf.

2016-04-25 10:44 GMT+02:00 Shiv Modi <shiv.modi4@gmail.com>:

Same issue.. Any solution?

--
Shiv Modi

Sent by Odoo S.A. using Odoo



--
Med venlig hilsen / Best Regards

Alex Lyngsøe

Alex Lyngsøe - IT & Forretningsoptimering
Bøelvej 19, DK-6690 Gørding
Tel. +45 28 56 00 30  CVR.Nr.: 30793277
mail@alexlyngsoe.dk  www.alexlyngsoe.dk   

Odoo OpenSource ERP solutions. Et fleksibelt Online ERP system med mange udvidelses- og tilpasningsmuligheder. Fra 190,- pr. bruger/måned. 

   
Câu trả lời hay nhất

When I installed Odoo.deb from Odoo website (also from nightly), every thing seems Ok, and logos (jpg&gif) printed in pdf reports, this mean that the issue is with the Github Odoo repository.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 18
7062
2
thg 1 16
10826
0
thg 10 23
1437
1
thg 10 22
2891
1
thg 4 23
1681