For printing-related purposes, Odoo 16 requires a wkhtmltopdf version higher than 0.12.2. Wkhtmltopdf is an open-source command line tool to render HTML data into PDF format using Qt webkit. To install wkhtmltopdf on your Ubuntu 22.04 server, follow the steps below.
The installation guide has instructions to install the wkhtmltopdf binary, version 0.12.3, from downloads.wkhtmltopdf.org into /usr/local/bin on Ubuntu 16.04, version 0.12.5 from RPM on CentOS 6 and 7, or version 0.12.4 on RedHat 7.4 into /usr/bin. I am in the process of building out an ansible playbook to build out my eramba production and development servers. Is there a reason to not use the version distrubted with Ubuntu 16.04.5 (wkhtmltopdf/xenial 0.12.2.4-1 amd64) or the latest stable version distributed in *.deb format by wkhtmltopdf.org, which is version 0.12.5?
Installing wkhtmltopdf on Linux can be a bit tricky, especially for people who are not so familiar with *nix operating systems. There are various ways in which you can install wkhtmltopdf; use a package manager such as apt-get, compile from source, or download the pre-compiled binary file. We are going to be doing the latter in this tutorial.
Then we will download and extract an archive containing the binary file. Be sure to update the link to use whichever version you prefer. You can find the links on the download page over at wkhtmltopdf.org.
Now we have a directory named wkhtmltox within our current working directory. This directory contains the binary file that we are looking for within the bin directory, namely wkhtmltopdf. We could just use that binary file from that directory as is, but we probably want to make wkhtmltopdf available throughout the system. To do that, we need to move it and give it permission to execute.
I wonder why SC puts all this third party software , which is not SC responsibility, wkhtmltopdf is not even used in SC i believe , pdf app type is hooked up in another pdf library.
you find a right version and plug it in.
I guess it is time SC cleans up the installation,
it is so huge , it is unbearable . also the update of the production env should be addressed,
how come there is no option to update it from the deployment center after the initial deployment
there is production environment , it is another place SC may consider to add upgrades such that a right version of the production libraries is pulled from the SC server.
I see a number other pdf libraries in prod/third such as qpdf, tcpdf
I make only custom pdf from html , therefore i use wkhtmltopdf, this requires a lot of customization
for headers, footers, TOC, quality.
but i think the standard export to pdf uses something much simpler
You might delete unused or customized third party libraries from ZIP before making an upload to your production. (such as wkhtmltopdf, otherwise SC files will overwrite your customizations).
#thirdparty #applications:prod-environment #deployment #wkhtmltopdf
by the way , I am using version 0.12.6 of wkhtmltopdf. previous versions had bugs.
you need wkhtmltopdf-amd64 for CENTOS
(centos is discontinued from 2022, you need to step over to Alamalinux. )
we run now dev and few production on #almalinux on Azure VM , works good except some #Azure limitations that are already solved.
no big deal, i was wondering if the standard export of scriptcase to pdf and pdf app are using wkhtmltopdf from the third parties lib at all. Cause if so , which functionality is using it and why they are using an old buggy version?
this command install an outdated wkhtmltopdf and odoo generate a wrong pdf (with 0 byte ) and popup error saying to update to the new wkhtmltopdf. So this is not a ODOO Error, but we can say it`s a wkhtmltopdf issue(moreover it`s a version issue).
Warning! Version in debian/ubuntu repos have reduced functionality (because it compiled without the wkhtmltopdf QT patches), such as adding outlines, headers, footers, TOC etc. To use this options you should install static binary from wkhtmltopdf site or you can use this script.
By default, PDFKit will run wkhtmltopdf with quiet option turned on, since in most cases output is not needed and can cause excessive memory usage and corrupted results. If need to get wkhtmltopdf output you should pass verbose=True to API calls:
wkhtmltopdf - the location of the wkhtmltopdf binary. By default pdfkit will attempt to locate this using which (on UNIX type systems) or where (on Windows).
If you are getting strange results in PDF or some option looks like its ignored you should try to run wkhtmltopdf directly to see if it produces the same result. You can get CLI command by creating pdfkit.PDFKit class directly and then calling its command() method:
Make sure that you have wkhtmltopdf in your $PATH or set via custom configuration (see preceding section). where wkhtmltopdf in Windows or which wkhtmltopdf on Linux should return actual path to binary.
This error means that PDFKit was unable to process an input. You can try to directly run a command from error message and see what error caused failure (on some wkhtmltopdf versions this can be cause by segmentation faults)
I am using wkhtmltopdf 0.10.0 rc2 on Ubuntu (Linux 3.2.0-24-generic #38-Ubuntu x86_64 GNU/Linux). The problem I'm experiencing is that I can't create PDFs with margin-top or margin-bottom. I'm not getting any errors.
Running wkhtmltopdf and wkhtmltoimage to create PDF files from HTML files on a Mac is easy and simple. When you need to install it on a non-mac production server a little bit of work is involved.
The Problem: Installing it simply via sudo apt-get install wkhtmltopdf on Ubuntu will install a reduced functionality version which is probably not what you want. According to the manual the reduced functionality version does not include the following features.
Reduced Functionality:
This version of wkhtmltopdf has been compiled against a version of QT without
the wkhtmltopdf patches. Therefore some features are missing, if you need
these features please use the static version.
It's me again. Still to little problems:
a) How can I tell wkhtmltopdf to wait some seconds until data on a page are fully loaded?
b) How can I print special characters like in the footer? (Actually, I get - printed instead)
P.S. If you create such an "URL-Catcher", please let us know .-)
I just downloaded the latest version for Windows (wkhtmltox-0.11.0_rc1-installer.exe) and I'll check to see if the options you're looking for are in it.
[Note: the Windows install puts it in C:\Program Files (x86)\wkhtmltopdf under Windows 7. Don't use the modify path option during install with Vista or Win7, it says it will break your path. You'll have to add it manually it seems.]
There's a manual page for version 0.10.0 and a Wiki (but the Wiki seems to be geared towards developers instead of users).
Regarding the copyright symbol, I know the version I was using had difficulties with some characters. Maybe that's all been fixed in this Release Candidate.
I tried to run command C:\Program Files (x86)\wkhtmltopdf\bin\wkhtmltopdf.exe *.html *.pdf and I get the error: C:\Program is not recognized as an internal or external command...
It doesn't seem to like the spaces in the Program Files (x86) folder.
This tutorial guides students and new users on how to install command-line tools, wkhtmltopdf and wkhtmltoimage, on Ubuntu 18.0416.04. These open-source tools convert HTML into PDF or image files using the Qt WebKit rendering engine, without requiring a display service. The instructions include downloading the latest .deb file, installing required packages, and verifying the installations. It also briefly describes how to use these tools.
Do you have issue with wkhtmltopdf install in ubuntu linux then i will help you how to solve that error. if you have error like qxcbconnection: could not connect to display wkhtmltopdf ubuntu.When i installed wkhtmltopdf on my ubuntu server and i run wkhtmltopdf command to generate pdf file from url. then i got following issue:"forge@billowing-star:$ wkhtmltopdf google.pdfqt.qpa.screen: QXcbConnection: Could not connect to displayCould not connect to any X display."
if you have same issue then i will help you how to resolve that issue using xvfb-run command. so let's see bellow step by step instruction.Install wkhtmltopdfsudo apt-get updatesudo apt-get install wkhtmltopdfAfter install wkhtmltopdf successfully, you can run following command to generate pdf fie from url. so let's run bellow command:Generate PDF File using wkhtmltopdfwkhtmltopdf google.pdfAfter that if you receive error like as bellow:Get Error Like bellow:qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display.Now you can resolve that error using xvfb command, so let's run bellow command:
Install xvfb:sudo apt-get updatesudo apt-get install xvfbnow you can easily generate pdf file using $ xvfb-run wkhtmltopdf command as bellow:Generate PDF File using xvfb wkhtmltopdf:xvfb-run wkhtmltopdf google.pdfNow it should generate pdf file.you can also create alias for xvfb-run wkhtmltopdf as like bellow:Create Alias:alias wkhtmltopdf='xvfb-run wkhtmltopdf'Use Alias:Read Also: Laravel Create PDF File with Image Examplewkhtmltopdf google.pdfI hope it can help you...Tags :