PHPackages                             suhanyu/wkhtmltopdf-amd64-mac-os - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. suhanyu/wkhtmltopdf-amd64-mac-os

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

suhanyu/wkhtmltopdf-amd64-mac-os
================================

wkhtmltopdf的Mac版可执行文件

v1.0.0(7y ago)22691

Since Nov 3Pushed 7y agoCompare

[ Source](https://github.com/suhanyujie/wkhtmltopdf-amd64-mac-os)[ Packagist](https://packagist.org/packages/suhanyu/wkhtmltopdf-amd64-mac-os)[ RSS](/packages/suhanyu-wkhtmltopdf-amd64-mac-os/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

wkhtmltopdf for Mac
===================

[](#wkhtmltopdf-for-mac)

背景
--

[](#背景)

- 最近一朋友让我协助解决一个问题，将word文档转成pdf文档 事实上，这个是可以通过PhpWord这个包来完成的，但是在其中有个需求是， 将word模板文件中的一些文字替换为最终的值，做到最后，发现如果使用dompdf包来完成时， 对英文的文档是ok的，但是遇到中文就会乱码，在laravel的论坛中，发现了使用这个 [https://github.com/barryvdh/laravel-snappy，](https://github.com/barryvdh/laravel-snappy%EF%BC%8C)可以解决这个问题
- 这个软件包有个以依赖：wkhtmltopdf
- laravel-snappy 包中提示可以去[https://github.com/KnpLabs/snappy#wkhtmltopdf-binary-as-composer-dependencies，](https://github.com/KnpLabs/snappy#wkhtmltopdf-binary-as-composer-dependencies%EF%BC%8C)直接使用composer直接安装这个依赖，但这个包是支持debian操作系统的，我本地是mac环境
- 为了解决这个依赖问题，只能去它的官网下载对应的版本：
- 在github上查看，还有一个仓库是有centos版本的，但找不到mac版本，于是我决定开一个仓库 用于存放mac版本的，便于其他人使用composer安装wkhtmltopdf的mac版本

安装
--

[](#安装)

- 它的系统架构是amd64
- `git clone https://github.com/suhanyujie/wkhtmltopdf-amd64-mac-os.git`
- 或者使用composer进行安装 `composer require "suhanyu/wkhtmltopdf-amd64-mac-os":"*"`
- 安装后，laravel的使用路径：`base_path('vendor/suhanyu/wkhtmltopdf-amd64-mac-os/bin/wkhtmltopdf')`
- 到项目根目录下，给可执行权限

```
chmod +x vendor/suhanyu/wkhtmltopdf-amd64-mac-os/bin/wkhtmlto*
```

使用
--

[](#使用)

```
$snappyPdf = new \Knp\Snappy\Pdf(base_path('vendor/suhanyu/wkhtmltopdf-amd64-mac-os/bin/wkhtmltopdf'));
$snappyPdf->generateFromHtml('test html', 'output.pdf');
```

问题
--

[](#问题)

- composer安装时，如果提示：`but these conflict with your requirements or minimum-stability.`

> 可以在composer.json文件加上以下选项：

```
"minimum-stability": "dev",
"prefer-stable": true
```

参考
--

[](#参考)

-

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2747d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc44ef31d005ec31158f4d6a91efc35ded1cb0d716cc61adc62f5e1c4560829f?d=identicon)[suhanyujie](/maintainers/suhanyujie)

---

Top Contributors

[![suhanyujie](https://avatars.githubusercontent.com/u/8400113?v=4)](https://github.com/suhanyujie "suhanyujie (8 commits)")

### Embed Badge

![Health badge](/badges/suhanyu-wkhtmltopdf-amd64-mac-os/health.svg)

```
[![Health](https://phpackages.com/badges/suhanyu-wkhtmltopdf-amd64-mac-os/health.svg)](https://phpackages.com/packages/suhanyu-wkhtmltopdf-amd64-mac-os)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
