phpwkhtmltopdf | slim PHP wrapper around wkhtmltopdf with an easy to use | Compression library

 by   mikehaertl PHP Version: 2.5.0 License: MIT

kandi X-RAY | phpwkhtmltopdf Summary

kandi X-RAY | phpwkhtmltopdf Summary

phpwkhtmltopdf is a PHP library typically used in Utilities, Compression applications. phpwkhtmltopdf has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

[Packagist PHP Version Support] PHP WkHtmlToPdf provides a simple and clean interface to ease PDF and image creation with [wkhtmltopdf] The wkhtmltopdf and - optionally - wkhtmltoimage command must be installed and working on your system. See the section below for details. For Windows systems make sure to set the path to wkhtmltopdf.exe in the binary option. Alternatively you can add the wkhtmltopdf "bin" directory to the system PATH variable to allow wkhtmltopdf command available to Windows CMD.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              phpwkhtmltopdf has a medium active ecosystem.
              It has 1557 star(s) with 239 fork(s). There are 65 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 4 open issues and 337 have been closed. On average issues are closed in 88 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of phpwkhtmltopdf is 2.5.0

            kandi-Quality Quality

              phpwkhtmltopdf has 0 bugs and 0 code smells.

            kandi-Security Security

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

            kandi-License License

              phpwkhtmltopdf is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              phpwkhtmltopdf releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              phpwkhtmltopdf saves you 136 person hours of effort in developing the same functionality from scratch.
              It has 341 lines of code, 27 functions and 3 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed phpwkhtmltopdf and discovered the below as its top functions. This is intended to give you an instant insight into phpwkhtmltopdf implemented functionality, and help decide if they suit your requirements.
            • Add arguments to the command
            • Ensure that the input is a URL or file .
            • Creates a PDF file .
            • Create the image
            • Set options .
            • Ensures that the options are valid .
            • Get mime type
            • Get the exec command
            • Get the image as string
            • Get image filename
            Get all kandi verified functions for this library.

            phpwkhtmltopdf Key Features

            No Key Features are available at this moment for phpwkhtmltopdf.

            phpwkhtmltopdf Examples and Code Snippets

            No Code Snippets are available at this moment for phpwkhtmltopdf.

            Community Discussions

            QUESTION

            Wkhtml to export pdf with utf-8 tamil language
            Asked 2021-Feb-13 at 15:32

            In command prompt direct command execution at windows command tamil language is exporting successfully

            wkhtmltopdf.exe --encoding UTF-8 http://localhost/pdfexport/phpwkhtmltopdf-master/page.html file/test.pdf

            But executing same command via PHP exec($cmd) tamil strings is not exporting.

            ...

            ANSWER

            Answered 2021-Feb-13 at 15:32

            To me this sounds like PHP was not configured correctly for UTF8 support. In pure PHP, without exec(), could you verify this echo "ஆங்கிலம்"; gets printed on screen in a webpage or script of sort? Do this indepenetly of wkhtmltopdf.

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

            QUESTION

            How to generate chartjs charts to pdf using laravel?
            Asked 2020-Oct-05 at 00:44

            I need to generate pdf report including chartjs charts. I use https://v6.charts.erik.cat/ realisation for creating charts and https://github.com/mikehaertl/phpwkhtmltopdf for pdf generating.

            ...

            ANSWER

            Answered 2020-Oct-05 at 00:44

            Your best bet is probably to render the chart as an image with a Javascript-enabled renderer, and then add that image to your PDF.

            Option 1: If you want to stick with headless rendering, you may need to add a --no-stop-slow-scripts option in addition to the Javascript delay (could also check out Puppeteer, an alternative renderer).

            Option 2: Use a service that renders charts to image or PDF. QuickChart is an open-source web service that does this (I am one of its maintainers).

            For example, take your Chart.js config:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install phpwkhtmltopdf

            Install the package through [composer](http://getcomposer.org):. Make sure, that you include the composer [autoloader](https://getcomposer.org/doc/01-basic-usage.md#autoloading) somewhere in your codebase.
            There have been many reports about corrupted PDFs or images when using send(). They are often caused by the webserver (Apache, Nginx, …​) performing additional compression. This will mess up the Content-Length header which is added by this library. It’s useful to let the browser show a progress bar.
            Exclude the download URL from compression in your Webserver. For example if your script is called pdf.php then for [mod_deflate](https://httpd.apache.org/docs/2.4/mod/mod_deflate.html) in Apache you could try to add this to your configuration: ``` SetEnvIfNoCase REQUEST_URI ^/pdf.php$ no-gzip dont-vary ``` For Nginx there are [similar solutions](https://serverfault.com/questions/438237/turn-off-gzip-for-a-location-in-nginx) to disable `gzip` for a specific location.
            Suppress the Content-Length header when you send a file (available since 2.5.0): ```php <?php $pdf->send('name.pdf', false, array( 'Content-Length' => false, )); $image->send('name.png', false, array( 'Content-Length' => false, )); ```
            It’s recommended that you download the latest wkhtmltopdf from their website:. These versions should run out of the box. If for some reason you can’t do so, you may run into an issue with the dynamically linked version of wkhtmltopdf. This is what you get for example on Ubuntu 12.04 LTS if you install the wkhtmltopdf package. It will work, but to use all features it requires an X server which is usually not available on headless webservers. We therefore provide two Xvfb based workarounds. You can either use. Both require the Xvfb package to be installed on the system and both also have some drawbacks.
            the built in Xvfb support or
            a standalone Xvfb server.

            Support

            Also check out my [php-pdftk](https://github.com/mikehaertl/php-pdftk) wrapper around pdftk which brings the full power of pdftk to PHP.
            Find more information at:

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

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mikehaertl/phpwkhtmltopdf.git

          • CLI

            gh repo clone mikehaertl/phpwkhtmltopdf

          • sshUrl

            git@github.com:mikehaertl/phpwkhtmltopdf.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Compression Libraries

            zstd

            by facebook

            Luban

            by Curzibn

            brotli

            by google

            upx

            by upx

            jszip

            by Stuk

            Try Top Libraries by mikehaertl

            php-pdftk

            by mikehaertlPHP

            php-shellcommand

            by mikehaertlPHP

            php-tmpfile

            by mikehaertlPHP

            packagecompressor

            by mikehaertlPHP

            pdfable

            by mikehaertlPHP