定制 michael-schaefer-eu/wkhtmltox 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

michael-schaefer-eu/wkhtmltox

Composer 安装命令:

composer require michael-schaefer-eu/wkhtmltox

包简介

wkhtmltopdf and wkhtmltoimage linux binaries - Convert HTML to PDF or IMAGE using Webkit (QtWebKit)

README 文档

README

This repository contains the latest stable compiled binaries of wkhtmltopdf and wkhtmltoimage from the wkhtmltopdf project.

The binaries are built for Ubuntu 18.04 bionic, amd64 and i386 architectures are included.

Why

Because apt package is outdated.

$ sudo apt install wkhtmltopdf

will install wkhtmltopdf version 0.12.4

When it's not possible to install the latest version via .deb package with apt

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt install ./wkhtmltox_0.12.5-1.bionic_amd64.deb

Or sometimes you just want a quick solution for your dev environment ;)

Installation

This package is published on Packagist and should be installed with Composer.

The version of the binary is equal to the git tag. Composer will install the latest version by default.

$ composer require-dev michael-schaefer-eu/wkhtmltox

Note: you should not use this package (or any other of that kind) in production environments!

Composer will install the package in your project path into the vendor/michael-schaefer-eu/wkhtmltox/ directory.

The binaries are located in the vendor/michael-schaefer-eu/wkhtmltox/bin/ directory.

Composer will symlink them to the vendor/bin/ directory.

Optional: You can also symlink them to the /usr/local/bin/ directory, as apt would install normally there.

$ ln -s /absolute/path/to/your/project/vendor/michael-schaefer-eu/wkhtmltox/bin/wkhtmltopdf-bionic-amd64 /usr/local/bin/wkhtmltopdf
$ ln -s /absolute/path/to/your/project/vendor/michael-schaefer-eu/wkhtmltox/bin/wkhtmltoimage-bionic-amd64 /usr/local/bin/wkhtmltoimage

Check the Version:

$ wkhtmltopdf -V
wkhtmltopdf 0.12.5 (with patched qt)

Usage

With the KNP-Snappy package, you can now use the binaries to create PDFs or Images from HTML.

You can use the path constants from this project to easily locate the binary paths (with PSR 4 Autoloader):

<?php
use Knp\Snappy\Pdf;
use Knp\Snappy\Image;
use Wkhtmltox\Wkhtmltopdf;
use Wkhtmltox\Wkhtmltoimage;

$snappyPdf = new Pdf(Wkhtmltopdf::BIONICAMD64);
$snappyImage = new Image(Wkhtmltoimage::BIONICAMD64)

OR If you symlinked the binaries to /usr/local/bin:

<?php
use Knp\Snappy\Pdf;
use Knp\Snappy\Image;

$snappyPdf = new Pdf('/usr/local/bin/wkhtmltopdf');
$snappyImage = new Image('/usr/local/bin/wkhtmltoimage');

License

This package is published under the same GNU General Public License v3.0 LICENSE as the wkhtmltopdf project.

michael-schaefer-eu/wkhtmltox 适用场景与选型建议

michael-schaefer-eu/wkhtmltox 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28.46k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2019 年 08 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「pdf」 「thumbnail」 「snapshot」 「convert」 「png」 「binary」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 michael-schaefer-eu/wkhtmltox 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 michael-schaefer-eu/wkhtmltox 我们能提供哪些服务?
定制开发 / 二次开发

基于 michael-schaefer-eu/wkhtmltox 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 28.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 28
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2019-08-05