2017-06-01 5 views
0

私は、背景イメージの上にテキストを配置するためにcssスタイルを使用するOdoo 9に関する新しいレポートを作成しています。画像は背景にあり、余白なしでフルA4ページを占有します。Odoo 9 cssが動作しないカスタムqwebレポート

htmlではうまくいきます。しかし、私はPDFにレポートを印刷するとき、私は左右に余白があり、テキストは背景画像の下になります。 CSSルールは適用されていないようです。 PDFで動作させるための解決策はありますか?

<template id="sub_proposal"> 
<style type="text/css"> 
    .container { 
     padding: 0mm; 
    } 
    #sponsor-ref { 
     position: absolute; 
     top: 84mm; 
     left: 45mm; 
    } 
    #form_image { 
     position: absolute; 
     top: 0mm; 
     left: 0mm; 
     width: 210mm; 
     height: 297mm; 
    } 
    #form_image img { 
     max-width: 100%; 
     max-height: 100%; 
     margin: auto; 
    } 
</style> 
<t t-call="report.html_container"> 
    <t t-foreach="docs" t-as="o"> 
     <div class="page"> 
      <div id="form_image"> 
       <span t-field="o.sub_proposal_form" t-field-options='{"widget": "image"}'/> 
      </div> 
      <span id="sponsor-ref" t-field="o.ref"/> 
     </div> 
    </t> 
</t> 

答えて

0

styleタグと内容が<div class="page">要素内に設定する必要があります。

は、ここに私のレポートです。

私は唯一の経験から、任意のドキュメントを持っていません。

Link to same question on Odoo forum

0

これは、PDFファイルにテキストと画像を印刷します

<template id="account_report_id" inherit_id="account.report_invoice_document"> 
    <p t-if="o.fiscal_position_id.note" position="after"><br/><br/> 
     <img t-if="o.partner_id.image" t-att-src="'data:image/png;base64,%s' % o.partner_id.image" style="float:right;max-height:40px;"/><br/><br/> 
     <span style="float: right;">Customer Sign</span> 
    </p> 
</template> 
関連する問題