Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Who as succesfully changed font type in PDF reports?

By
Pascal Tremblay
on 12/11/14, 8:17 PM 3,923 views

Hello all,

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

I'm on Odoo v8.

Thanks

1

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.

1

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 12/15/14, 8:55 PM

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.

1
C. Makkinje
On 12/15/14, 8:47 AM

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.

Pascal Tremblay
on 12/15/14, 8:49 AM
0
Andrei Levin
On 11/12/15, 9:48 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/11/14, 8:17 PM
Seen: 3923 times
Last updated: 11/12/15, 9:48 AM