Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: Run wkhtmltopdf under docker

by Landis Arnold <landis@nomadic.net> - 13/04/2017 12:47:48
We actually installed wkhtmltopdf after postgres and before Odoo.

# Intall wkhtmltox from Odoo - Used for HTML to PDF for reports
# *************************************************************
#    We need the upstream version, taken from URL:
#    https://www.odoo.com/documentation/8.0/setup/install.html
# ---------------------------------------------------------------------------
# Danager
#  To print PDF reports, you must install wkhtmltopdf yourself: the version of
#  wkhtmltopdf available in debian repositories does not support headers and
#  footers so it can not be installed automatically. The recommended version is
#  0.12.1 and is available on the wkhtmltopdf download page, in the archive
#  section. As there is no official release for Debian Jessie, you can find
#  ours on http://nightly.odoo.com/extra/.
# ---------------------------------------------------------------------------
#
cd /tmp
[ "$FAB_HTTP_PROXY" ] && export HTTP_PROXY=$FAB_HTTP_PROXY
wget http://nightly.odoo.com/extra/wkhtmltox-0.12.1.2_linux-jessie-amd64.deb
unset HTTP_PROXY
dpkg -i wkhtmltox-*.deb
ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
ln -s /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage


From. https://github.com/turnkeylinux-apps/odoo/blob/

Might be dated by now.  This was vers 8.0 Odoo.  Need to start the move to 9 10 and 11 I am sure.

I need to go back in time to follow this more clearly but, at the time of build I recall complications in getting the functional build to be installed rather than the most recent one.

Anyway, one method here.

Landis Arnold


Sent from Nine

From: Landis Arnold
Sent: Apr 13, 2017 6:29 AM
To: Odoo Community Association (OCA) Contributors
Subject: Re: Run wkhtmltopdf under docker

And a backport your module to 8.0 as well would also be great.

Very cool to put more print controls in as 6ou describe.
wkhtmltopdf was one of the more complicated parts of our installation I recall

Landis Arnold

Sent from Nine

From: Ermin Trevisan <trevi@twanda.com>
Sent: Apr 13, 2017 5:08 AM
To: Contributors
Subject: Re: Run wkhtmltopdf under docker

Thanks for that one, really cool. Could you also create a backport to 9.0?


On 13.04.2017 08:53, Miku Laitinen wrote:
<blockquote cite="mid:CAD-eYik2BV3q6nd-YgpHsHJXmJK5a8_4W1cjAEZ5bPr8j5JnGg@mail.gmail.com" type="cite">
Hi all,

Not related to the original question, but I wanted to pass --disable-smart-shrinking to wkhtmltopdf (for a specific print) without modifying the Docker image or container in any way, so I created a simple module called report_paper_params. It allows you to disable smart shrinking, or specify any other wkhtmltopdf parameter by paper size in Odoo. I hope it proves useful.

On Thu, Apr 13, 2017 at 9:07 AM Jordi Ballester Alomar <jordi.ballester@eficent.com> wrote:
Hi Graeme,

I have tried your approach, and works like a charm :)

Certainly the main issue was the smart shrinking. We are designing the check printing in a standard format called DLT103 - https://github.com/OCA/account-payment/tree/9.0/account_check_printing_report_dlt103 - and the dimensions need to be perfect in order to ensure proper alignment with the checl.

I created a new file 'wkhtmltopdf' as follows:

#!/bin/sh

/usr/local/bin/wkhtmltopdf-bin --disable-smart-shrinking "$@"





On Thu, Apr 13, 2017 at 6:08 AM, Graeme Gellatly <gdgellatly@gmail.com> wrote:
Jordi,

Let me start with the presumption that really your preference is not to dockerize wkhtmltopdf.  I too had similar trouble with stretch, which as its about to become stable I guess Odoo is about to have same problem.

wkhtmltopdf 0.12.5 looks promising however is not here yet.  I am having good results with 0.12.4 however in order to get sizing the same as 0.12.1 need to add --disable-smart-shrinking to the commandline.  It does however resolve the dpi issues on Linux of 12.3 and 12.2.  (Mac still broken, windows idk)

My thoughts are just to write a simple bash script called wkhtmltopdf which takes the arguments, adds the missing option and passes to wkhtmltopdf-bin (renamed binary).
On Wed, Apr 12, 2017 at 7:53 PM, Jordi Ballester Alomar <jordi.ballester@eficent.com> wrote:
Hi! Has anyone attempted to run wkhtmltopdf under a docker container (separate from odoo).

We are struggling to install normal.wkhtmltopdf 0.12.1 in debian stretch, and docker seems so much easier in principle.

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

--
Miku Laitinen
AVOIN.SYSTEMS
+358 44 239 1985

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


-- 
twanda AG
Ermin Trevisan
Artherstrasse 19
CH-6318 Walchwil 
T    +41 41 758 1515
M    +41 79 208 7373
E    trevi@twanda.com 
www.twanda.ch
www.gastrosoftware.ch

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe