Giter Site home page Giter Site logo

h4cc / wkhtmltopdf-amd64 Goto Github PK

View Code? Open in Web Editor NEW
462.0 18.0 169.0 71.96 MB

wkhtmltopdf - Convert html to pdf using webkit (qtwebkit). Linux amd64 Binary.

Home Page: http://wkhtmltopdf.org/

License: GNU Lesser General Public License v3.0

PHP 100.00%

wkhtmltopdf-amd64's Introduction

wkhtmltopdf

This repository contains the static compiled binaries from the wkhtmltopdf project. More about the functionality of wkhtmltopdf and wkthmltoimage can be found there.

Binaries for Microsoft Windows, also installable with composer, can be found here: github.com/wemersonjanuario/wkhtmltopdf-windows

Binaries for CentOS 7, also installable with composer, can be found here: github.com/rvanlaak/wkhtmltopdf-amd64-centos7

Installation

Hint: The version of the binary is equal to the git tag. To install the latest version, use '0.12.4'.

Packagist

This package can be found on Packagist and installed with Composer.

Require the package for i386 with:

php composer.phar require h4cc/wkhtmltopdf-i386 "0.12.4"

And for amd64 with:

php composer.phar require h4cc/wkhtmltopdf-amd64 "0.12.4"

The binary will then be located at:

vendor/h4cc/wkhtmltopdf-i386/bin/wkhtmltopdf-i386

Also a symlink will be created in your configured bin/ folder, for example:

vendor/bin/wkhtmltopdf-i386

Usage

You can use the path constant to easily locate the binary in the PHP codebase:

$path = \h4cc\WKHTMLToPDF\WKHTMLToPDF::PATH;

For realpath use following script

$realpath = realpath(\h4cc\WKHTMLToPDF\WKHTMLToPDF::PATH);

wkhtmltopdf-amd64's People

Contributors

h4cc avatar hannesvdvreken avatar marclaporte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wkhtmltopdf-amd64's Issues

Provide statically-compiled binaries

Please provide statically-compiled binaries so that we don't have to install any external dependencies like libxrender1, libfontconfig1, and libxext6.

libjpeg old version (libjpeg.so.8)

Hi,

The wkhtmltopdf-amd64 binary is compiled with an old version of libjpeg:

ldd wkhtmltopdf-amd64 | grep libjpeg
./wkhtmltopdf-amd64: /usr/lib64/libjpeg.so.8: version `LIBJPEG_8.0' not found (required by ./wkhtmltopdf-amd64)
    libjpeg.so.8 => /usr/lib64/libjpeg.so.8 (0x00007f92f09dd000)

Latest version of libjpeg is 62 (libjpeg.so.62).

Is there any workaround for this?
Or maybe you can compile the binary with the latest version of libjpeg?

Will be glad for any help.
Thanks ahead!
Chen

Can't access binaries

Hi, I've tried to use your bundle but I haven't been able. It throws me an error:

Warning: Unknown: A session is active. You cannot change the session module's ini settings at this time in Unknown on line 0

Do you know why?

This is knp snappy bundle config:

knp_snappy:
    pdf:
        enabled:    true
        binary:     %kernel.root_dir%/../bin/wkhtmltopdf-amd64
        options:    []

How should I use your bundle?

Thanks!

Errors on require

Composer returns a bunch of of errors when I run composer require h4cc/wkhtmltopdf-amd64.

The package works in the end, but the errors then come up anytime I run any other composer commands, which gets really confusing with multiple packages.

I've pasted the complete output below.

The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

Using version 0.12.2.1 for h4cc/wkhtmltopdf-amd64
./composer.json has been updated
Loading composer repositories with package information

The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

Updating dependencies (including require-dev)
  - Installing h4cc/wkhtmltopdf-amd64 (0.12.2.1)
    Downloading: 100%
    Downloading: 100%
    Downloading: 100%

    Failed to download h4cc/wkhtmltopdf-amd64 from dist: The "https://api.github.com/repos/h4cc/wkhtmltopdf-amd64/zipball/9ea617154cf88b81c7c0f5e5fa2d2f731ba0ae6c" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
    Now trying to download from source

  - Installing h4cc/wkhtmltopdf-amd64 (0.12.2.1)
    Cloning 9ea617154cf88b81c7c0f5e5fa2d2f731ba0ae6c

Writing lock file
Generating autoload files

It seems not to be static in fact

file ~/Downloads/wkhtmltopdf-amd64
/Users/albert/Downloads/wkhtmltopdf-amd64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=b6566a9e44c43a0eebf18d8c1dc6cb616801a77e, stripped

Binary Files Causing Errors on Amazon Linux 2023

Hello,

I wanted to bring to your attention that the binary files in this project are causing errors on operating systems like Amazon Linux 2023. This seems to be due to the fact that these systems use OpenSSL 3 and libpng 1.6, among others.

I have found a workaround for this issue by installing wkhtmltopdf on the system using Alma Linux 9 with the following command:

dnf install -y https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.almalinux9.$(uname -m).rpm

This solution eliminates the need to install this package. I hope this information is helpful and leads to a resolution of the issue.

Best regards, Alejandro.

Unable to load library icui18n

I get this error:

The exit status code '1' says something went wrong: stderr: "Unable to load library icui18n "Cannot load library icui18n: (icui18n: cannot open shared object file: No such file or directory)"

OS: ubuntu1404-x64
wkhtmltopdf: 0.12.2.1

I tried

apt-get icui18n but ubuntu can't find that package. I also tried using this fix wkhtmltopdf/wkhtmltopdf#2242 but the answer was to download wkhtmltopdf via apt-get. Is there a better solution?

wkhtmltopdf-amd64 iframe issue

I am using wkhtmltopdf in my linux server. i have to convert an html to pdf. html contains two iframes and other data. when converting iframe data is not appearing all other data is comming. please help me i am stuck

Issue with

I am trying to run wkhtmltopdf-amd64 on a linux server and I am getting the following error

./wkhtmltopdf-amd64: /lib64/libc.so.6: versionGLIBC_2.9' not found (required by ./wkhtmltopdf-amd64)
./wkhtmltopdf-amd64: /lib64/libc.so.6: version GLIBC_2.10' not found (required by ./wkhtmltopdf-amd64) ./wkhtmltopdf-amd64: /lib64/libc.so.6: versionGLIBC_2.7' not found (required by ./wkhtmltopdf-amd64)`

the library libc.so.6 exists in /lib64 but apparently the version is older. I can't get the version since dpkg is not active on the shared environment. Can I use an earlier version of libc.so.6? Any ideas of how to circumvent this problem?

Can not execute binary file

Hello! First of all... let me thank you for this awesome work!
Now... i read in a closed issue that the library only works in a Linux System.
I'm developing in a OS X machine, my prod server runs with linux, but i need to ensure that the app works before pushing it to production.

There's any chance to install this bundle via composer and try it in a mac??

Thank you so much!

The process has been signaled with signal "11"

We use your program via a php wrapper named knplabs/knp-snappy and sometimes we got error on pdf document generation.

Command:

../vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality --margin-bottom '4mm' --margin-top '20mm' --page-size 'A4' --images --footer-center 'https://www.ourwebsite.com' --footer-font-size '8' --footer-right 'page [page]' --header-html '/tmp/knp_snappy5db928d806a466.90904693.html' '/tmp/knp_snappy5db928d80699b3.47497623.html' '/tmp/newdoc.pdf'

Result:

The process has been signaled with signal "11"

Can someone tell us the signification of this signal 11 in your program ?

OS: Amazon Linux 2

Thanks

Mac M1 ARM

Hey guys!

There is a possibility to create and ARM package??

Status code '139'

Hi, I have installed and tried both amd64 and i386 version on a Linux machine. I'm using Symfony 2.3.
When I try to generate the pdf document I get this error:

The exit status code '139' says something went wrong:
stderr: "/home/ktsport/app/../bin/wkhtmltopdf-i386: line 7: 31190 Segmentation fault (core dumped) "$BIN_TARGET" "$@"
"
stdout: ""
command: /home/ktsport/app/../bin/wkhtmltopdf-i386 --lowquality '/tmp/knp_snappy53398180a02de1.49102184.html' 'bundles/syliusweb/prueba.pdf'.

The error is the same for amd64.
This is my config:

knp_snappy:
    pdf:
        enabled:    true
        binary:     %kernel.root_dir%/../bin/wkhtmltopdf-i386
        options:    []

Including Bootstrab not working

I run in PHP 8.2.21, Symfony: 7.0.10
When I use "%kernel.project_dir%/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64" the Bootstrab has no effect.
When I use xvfb-run wkhtmltopdf Bootrstrab is processing correctly.

Code:
Controller

            $html = $this->renderView('pdf/pdf_report.html.twig', $parameters);
            $content = $knpSnappyPdf->getOutputFromHtml($html, [
                'margin-top' => 20,
                'margin-bottom' => 15,
                'margin-left' => 10,
                'margin-right' => 10,
            ]);

pdf_base.html.twig

<!DOCTYPE html>
<html lang="en">
<head>
    <title>{{ siteInfo.title }}</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="{{ absolute_url(asset('assets/bootstrap-5.1.3/css/bootstrap.css')) }}" rel="stylesheet" type="text/css">
</head>
<body>

<div class="mx-auto" style="width: 100%;">
    <div class="container">
        {% block title %}
            <h2 style="text-align: center;">{{ siteInfo.title }}</h2>
            <h3 style="text-align: center;">{{ siteInfo.subTitle }}</h3>
        {% endblock %}

        {% block body %}{% endblock %}

    </div>
</div>
</body>
<style>
    table th {
        background: rgb(224, 224, 255);
        text-align: left;
    }
</style>
</html>

vendor/ bin/wkhtmltopdf-amd64 error when pdf is generated

Hello,
I installed this bundle on a 5.2 version of symfony and I use it in the .env as follows: WKHTMLTOPDF_BINARY=vendor/ bin/wkhtmltopdf-amd64 but I have an error 'The exit status code' 127 'says something went wrong: nstderr: ' sh: 1: vendor / h4cc / wkhtmltopdf-amd64 / bin / wkhtmltopdf-amd64: not found n ' nstdout : '' ncommand: vendor / h4cc / wkhtmltopdf-amd64 / bin / wkhtmltopdf-amd64 --replace date '20210204215534 + 01 ' --lowquality '/tmp/knp_snappy601d091e3c97c9.46875142.html /fa_d09d046875142.html /''fa1d09d0d0d09d0d09d0d0d09d09d0d09d09d09dc09d09dc09d09dc09d09d09dc09d09d09dc09d09d09d09d1d09d09d09d09d09d09d09d09d09d09d09d09d09d09d09 .34032731.pdf '
do you know how to solve it please?

Possibility to include OS X version?

Hi,

Since you both provide AMD-64 and i386 versions, I wonder why there is no OS X version available via Composer?

Our scenario is, that we develop on OS X and deploy on Linux. Having all dependencies from one (reliable) source has our preference. Any idea if you are willing to include OS X version as well?

Otherwise I'm about to fork your repositories and include the OS X version myself. Which I'd rather not start doing.

config for knpsnappy bundle

What should the link to the binary be, when configuring knpsnappy?
Currently I have:

knp_snappy:
        pdf:
            enabled:    true
            binary:     "%kernel.root_dir%/../bin/wkhtmltopdf-amd64"
            options:    []
        image:
            enabled:    false
            binary:     "%kernel.root_dir%/../bin/wkhtmltoimage-amd64"
            options:    []

Is that correct?

Doing this, is giving me a permission denied error when knpsnappy tries to use the binary. should there be some instructuions for this in your installation guide?

Furthermore there is a type I believe in the install guide where it says /vendor/bin....

Also provide the CentOS7 binary?

We have a problem with deploying our application to Platform.sh, which uses a different OS (debian) as our current production environment does (centos7).

Basically, your repo supports the debian os perfectly but we can not use it for our production environment because that relies on the centos7 package. That's why I've published the centos7 version to Packagist, see https://github.com/rvanlaak/wkhtmltopdf-amd64-centos7

The problem we face is explained at this StackOverflow question, basically we can not install the proper package while publishing the new build.

This would work if your repository would support all binaries, and the correct binary would be symlinked based on an OS check. This would mean adding extra files to your repository, and adding a script that checks the OS before symlinking it. What do you think about this? That would allow me to deprecate my own repository because people can always make use of your repo.

Abandoned?

This package seems to be abandoned, I would advise people not to use this.

Unfortunately I don't know of a good alternative to this package. A couple of people forked it, updated it and announced they would maintain their version in the future, only to promptly abandon it.

This package isn't required if you have the possibility to get wkhtmltopdf installed natively, which is the preferred solution. But you probably wouldn't be looking here if you have that option available.

If anybody has a real alternative please let me know.

Alpine Linux

Has anyone used this on Alpine linux?
Does this really work out of the box?
Don't we still need to install the runtime dependencies ?
If so, can someone confirm the following dependencies?

Dist. Dependencies
Debian apt-get install xfonts-base xfonts-75dpi
Alpine apk add ttf-freefont fontconfig

Binaries for Debian 8 (Jessie)

Hi,

This is not an issue but a suggestion : do you plan to provide wkhtmlto* binaries for Debian 8 (Jessie) ?

Best regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.