Skip to Content
Menú
This question has been flagged
2 Respostes
137 Vistes
<table style="width: 100%;border: 0px solid transparent;" class="o_selected_table">
    <tbody><tr>       
        <td style="text-align: center; vertical-align: top;" class="o_selected_td">
            <img src="{{image_data_uri(object.sudo().test_user.user_id.sign_signature)}}" style="width: 200px; height: auto;border: none !important;">
        </td>     


When I render it in html it's all fine:


When I download the pdf, the img has very strange borders:

Does anybody have an idea how to get rid of them?



Avatar
Descartar
Best Answer

Hi,


Try the following.

1- Remove borders and outlines completely.


<img src="{{ image_data_uri(object.sudo().test_user.user_id.sign_signature) }}"

     style="width: 200px; height: auto; border: none; outline: none; box-shadow: none; background: transparent;"/>


2- Use table-borderless.


<table style="width: 100%;" class="table table-borderless">

    <tbody><tr>        

        <td style="text-align: center; vertical-align: top;" class="o_selected_td">

            <img src="{{image_data_uri(object.sudo().test_user.user_id.sign_signature)}}" style="width: 200px; height: auto;border: none !important;">

        </td>   



Hope it helps

Avatar
Descartar
Best Answer

Odoo uses an (old) external Python library to generate PDF's while your (modern) browser generates the HTML.

Browser

  • highly evolved, powerful rendering engine that handle CSS, flexbox, and complex layouts with great accuracy and consistency

Python Library

  • more limited rendering engine (dependent on the verion of WebKit installed ) which may not fully support all modern CSS features, especially those related to layout and borders.


Here are a few things to try:

Avatar
Descartar

Hey Ray
While at it already, got a rough ETA or a potential version of Odoo to look forward to regarding https://github.com/odoo/paper-muncher? v20, v21, ...?

We (not me, the smart folks I work with) have been on a quest for years to find a robust, open-source, and architecturally sound solution for this, but nothing out there quite fits the bill.

What you found is the result of some pioneering co-workers who just wouldn't take no for an answer and ended up with a side project that got entirely out of hand and is a real contender for what we do next.

Our target is Odoo 20.0. It is a huge undertaking whichever way we end up going, and timelines can shift a bit, but that's what we're aiming for. We appreciate you being excited about what's coming next—we are too!

Related Posts Respostes Vistes Activitat
2
d’ag. 20
4151
7
de febr. 19
6362
1
de febr. 24
3067
1
de set. 19
7643
0
d’oct. 16
3787