Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
14539 มุมมอง

Hello all,

Somebody here know how to change the font type in a PDF report?

I'm on Odoo v8.

Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I had the same problem but managed it with report.style

Howto:

  1. Install the truetype font under /usr/share/fonts & restart server

  2. Goto website and choose html editor

  3. Choose style from dropdown and add your font under body

  4. body {

    color: #000 !important;

    word-wrap: break-word;

    font-family: Open Sans;

    }

  5. Save it and generate the qweb report.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Pascal, I'm strugling with the same problem. Managed to change the font type of the HTML but as soon as you turn them back into PDF font is back to basic. 

อวตาร
ละทิ้ง
ผู้เขียน

If I find solution, I will come back here to write it.

ผู้เขียน คำตอบที่ดีที่สุด

Look at this one, it works for me today. It's the only CSS I need for the moment. 

<?xml version="1.0"?>
<t t-name="account.report_invoice_document">
    <t t-call="report.external_layout">
        <div style="font-family: Ubuntu;" class="page">
            <div class="row">
                <div class="col-xs-5 col-xs-offset-7">
                     <h4><strong>Invoicing address : </strong></h4>
                           <div style="margin-left: 20px;">
                                     <address t-field="o.partner_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>
                                     <span t-field="o.partner_id.vat"/>
                            </div>
                </div>
            </div>

 

.......

See PDF with the margin-left and Ubuntu font.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Style should be defined inline. File containing custom CSS is not found during PDF conversion.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ย. 24
8114
1
เม.ย. 25
1416
2
มี.ค. 25
1683
4
พ.ย. 24
7325
1
มี.ค. 24
2225