wkhtmltopdf | Convert HTML to PDF using Webkit | Document Editor library

 by   wkhtmltopdf C++ Version: 0.12.6 License: LGPL-3.0

kandi X-RAY | wkhtmltopdf Summary

kandi X-RAY | wkhtmltopdf Summary

wkhtmltopdf is a C++ library typically used in Editor, Document Editor applications. wkhtmltopdf has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has medium support. You can download it from GitHub.

wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF and various image formats using the QT Webkit rendering engine. These run entirely "headless" and do not require a display or display service. See for updated documentation.

            kandi-support Support

              wkhtmltopdf has a medium active ecosystem.
              It has 13245 star(s) with 1709 fork(s). There are 390 watchers for this library.
              It had no major release in the last 12 months.
              There are 1332 open issues and 2302 have been closed. On average issues are closed in 291 days. There are 25 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of wkhtmltopdf is 0.12.6

            kandi-Quality Quality

              wkhtmltopdf has 0 bugs and 0 code smells.

            kandi-Security Security

              wkhtmltopdf has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              wkhtmltopdf code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              wkhtmltopdf is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              wkhtmltopdf releases are available to install and integrate.
              It has 13500 lines of code, 0 functions and 181 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of wkhtmltopdf
            Get all kandi verified functions for this library.

            wkhtmltopdf Key Features

            No Key Features are available at this moment for wkhtmltopdf.

            wkhtmltopdf Examples and Code Snippets

            No Code Snippets are available at this moment for wkhtmltopdf.

            Community Discussions


            Batch file for generating automatic local PDF filenames with wkhtmltopdf
            Asked 2022-Mar-13 at 11:17

            I have a simple batch file with which I want to use the wkhtmltopdf to create PDF files of an archived set of URLs.

            The simple command of my batch file for wkhtmltopdf is as follows



            Answered 2022-Mar-13 at 11:17

            There could be used the following commented batch file:

            Source https://stackoverflow.com/questions/71242093


            Docker Build Error with Sockets and php-fpm 8.0 invalid application of 'sizeof' to incomplete type 'struct cmsgcred'
            Asked 2022-Feb-12 at 01:56

            I have a custom Docker build of nginx and php-fpm that I am pretty sure was working until recently. I am now getting the error mentioned above during a build using the DockerFile below when using 8.0-fpm, but not with 8.1.1-fpm-bullseye, although there are some other issues with using 8.1.1 in some of the PHP code (deprecations and warnings).



            Answered 2022-Feb-12 at 01:56

            PHP 8.0.15 and 8.1.2 has a bug which is breaks compile sockets extension.

            You have a two options:

            1. Skip this versions.
            2. Apply a workaround to bypass bug and build sockets extenstension.


            Source https://stackoverflow.com/questions/71074432


            How to set wkhtmltoimage path when using imgkit in google colab?
            Asked 2022-Jan-28 at 14:44

            Im trying to save an html file as an image using imgkit in google colab. Im having trouble making it work.



            Answered 2022-Jan-28 at 13:35

            You need to install the executable. Check your operating system with

            Source https://stackoverflow.com/questions/70893465


            How to improve the HTML Table Styling that is to be converted into a PDF File
            Asked 2022-Jan-25 at 00:43

            I have a Python code that is creating HTML Tables and then turning it into a PDF file. This is the output that I am currently getting

            This image is taken from PDF File that is being generated as result (and it is zoomed out at 55%)

            I want to make this look better. Something similar to this, if I may

            This image has 13 columns, I don't want that. I want to keep 5 columns but my major concern is the size of the td in my HTML files. It is too small in width and that is why, the text is also very stacked up in each td. But if you look at the other image, text is much more visible and boxes are much more bigger width wise. Moreover, it doesn't suffer from height problems either (the height of the box is in such a way that it covers the whole of the PDF Page and all the tds don't look like stretched down)

            I have tried to play around the height and width of my td in the HTML File, but unfortunately, nothing really seemed to work for me.

            Edit: Using the code provided by onkar ruikar, I was able to achieve very good results. However, it created the same problem that I was facing previously. The question was asked here: Horizontally merge and divide cells in an HTML Table for Timetable based on the Data in Python File

            I changed up the template.html file of mine and then ran the same code. But I got this result,

            As you can see, that there were more than one lectures in the First Slot of Monday, and due to that, it overlapped both the courses. It is not reading the

            command properly in this HTML file now.

            The modified template.html file has this code,



            Answered 2022-Jan-25 at 00:43

            What I've done here is remove the borders from the table and collapsed the space for them.

            I've then used more semantic elements for both table headings and your actual content with semantic class names. This included adding a new element for the elements you want at the bottom of the cell. Finally, the teacher and codes are floated left and right respectively.

            Source https://stackoverflow.com/questions/70807885


            How to resolve libwkhtmltox.so reference in .Net AWS Lambda Docker image
            Asked 2022-Jan-17 at 08:17

            I'm converting a .Net 2.1 lambda to 3.1 (or higher) and struggling with resolving the references that convert html to pdf. I'm currently using code from this solution https://github.com/HakanL/WkHtmlToPdf-DotNet, which works fine running a console app in the container. The lambda package is introducing issues that break this logic. Using a new lambda solution with this WkHtmlToPdf-DotNet project, the deployed image fails with this exception

            GetModule WkHtmlModuleLinux64 Exception System.DllNotFoundException: Unable to load shared library '/var/task/runtimes/linux-x64/native/libwkhtmltox.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libjpeg.so.62: cannot open shared object file: No such file or directory

            I am using the LD_DEBUG environment variable which shows before the exception: file=runtimes/linux-x86/native/libwkhtmltox [0]; dynamically loaded by /var/lang/bin/shared/Microsoft.NETCore.App/5.0.12/libcoreclr.so [0]

            And I also output to the log a search for the file which yields this line:
            GetFilePath res: /var/task/runtimes/linux-x64/native/libwkhtmltox.so

            Any suggestions how to continue to troubleshoot this?

            Thanks, Reuven



            Answered 2022-Jan-17 at 08:17

            I was able to resolve this issue by installing few of the packages that is required by DinkToPdf library in a docker container environment.

            The issue however for installing those packages were not straight forward in Amazon Linux 2 instances. Below is the docker file I had to add for the DinkToPdf work properly.

            Source https://stackoverflow.com/questions/70525819


            Horizontally merge and divide cells in an HTML Table for Timetable based on the Data in Python File
            Asked 2022-Jan-15 at 06:02

            Please note this question is an extension of this previously asked question: How to make Images/PDF of Timetable using Python

            I am working on a program that generates randomized Timetable based on an algorithm. For the Final Output of that program, I require a Timetable to be stored in a PDF File.

            There are multiple sections and each section must have its own timetable/schedule. Each Section can have multiple Courses whose lectures will be allocated on different slots from Monday to Friday by the algorithm. For my timetable,

            • There are 5 days in total (Monday to Friday)
            • Each day will have 5 slots (0 to 4 in indexes. With a "Lunch" Break between 3rd and 4th slot)

            As an Example, I have created below a dictionary where key represents the Section and the items have a 2D Array of size 5x5. Each Index of that 2D array contains the course details for which the lecture will take place in that slot.



            Answered 2022-Jan-15 at 06:02

            I am not much familiar with Jinja, so this answer might not be the most efficient one.

            By using basic hard coding in your Template.HTML file, I was able to achieve the results you are trying to. For this, I used the same code that was given by D-E-N in your previous question.

            I combined all the attributes of your object into a string

            • An attribute is differentiated from another with @ (like Course and Teacher)
            • Instead of using space character, I used a _ character to represent space character in the attributes.
            • If one slot contains multiple objects, they are differentiated with space character (just like in the code provided by D-E-N)

            Here's the updated code of yours with these changes,

            Source https://stackoverflow.com/questions/70623210


            Adjustment to docker-compose.yml for M1 chip?
            Asked 2022-Jan-11 at 14:28

            I have a docker-compose.yml that builds about 8 containers made up mostly of mysql, postgres, php-nginx and a few other packages that are custom builds. The production version runs on an UBUNTU host, and my development package runs on Mac OS Catalina with an Intel Chip. The whole thing is also maintained in a private repo on Github.

            A collaborator has an M1 Mac, and I'll likely upgrade to an M1 Mac shortly, either a MacBook Pro or the 27" iMac when those are released maybe later this year.

            We tried installing the package on his M1 Mac and ran into a few problems, and likely more.

            One issue appears to be related to the MySQL build in the compose file (some items removed)



            Answered 2022-Jan-11 at 14:27

            For M1 processor you have to specify platform

            Source https://stackoverflow.com/questions/70658693


            getting error on try to use wkhtmltopdf.exe and passing 2 params by url
            Asked 2022-Jan-04 at 09:33

            my execute script : C:\\fortest\\wkhtmltopdf.exe http://localhost:5004/X/Y?a1=1&a2=23 google.pdf

            I getting the error

            'a2' is not recognized as an internal or external command, operable program or batch file.

            by browser its look like that :

            I hid some of the data because it could be sensitive



            Answered 2022-Jan-04 at 09:33

            Enclose url in quotes:

            Source https://stackoverflow.com/questions/70576084


            Trouble using wkhtmlpdf gem
            Asked 2021-Dec-28 at 10:26

            I am having trouble using wkhtmlpdf gem on my machine. OS - ZorinOS. This is the error I am getting when trying to download or view a pdf file on the rails server -

            Error: PDF could not be generated! Command Error: /home/my-user/.rvm/gems/ruby-3.0.1@somename/gems/wkhtmltopdf-binary- `': Invalid platform, must be running on Ubuntu 16.04/18.04/20.04 CentOS 6/7/8, Debian 9/10, archlinux amd64, or intel-based Cocoa macOS (missing binary: /home/my-user/.rvm/gems/ruby-3.0.1@somename/gems/wkhtmltopdf-binary- (RuntimeError)

            I tried following this command to try to resolve which I found on a GitHub issue for wkhtmltopdf_binary_gem. But this too could not solve it.



            Answered 2021-Dec-28 at 10:26

            The issue seems to be because of the platform. Based on your OS it is trying to search the binary for wkhtmltopdf_zorin_16_amd64 which the gem does not have.

            The best solution would be to try:

            1. creating a symlink mentioned in the GitHub issue you linked with the question - here

            Source https://stackoverflow.com/questions/70505206


            wkhtmltopdf with php:8-fpm-alpine
            Asked 2021-Dec-07 at 11:28

            I have an existing php:8-fpm-alpine Dockerfile, and i need to add WKHTMLTOPDF package. Is that even possible. I tried using following dockerfile, but i get following error log:




            Answered 2021-Dec-07 at 11:28

            I faced a similar problem with php:7.4-fpm-alpine image.

            It seems like wkhtmltopdf is missing in Alpine v.3.15, but it is available in v.3.14.

            Try to change

            Source https://stackoverflow.com/questions/70245818

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install wkhtmltopdf

            You can download it from GitHub.


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone wkhtmltopdf/wkhtmltopdf

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link