PHPackages                             icarexm/poster - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. icarexm/poster

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

icarexm/poster
==============

the new poster extend

021PHP

Since May 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/icarexm/php-tools-poster)[ Packagist](https://packagist.org/packages/icarexm/poster)[ RSS](/packages/icarexm-poster/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

使用`Composer`安装`icarexm`的海报生成类库：

```
composer require icarexm/poster:dev-master

```

生成二维码
-----

[](#生成二维码)

> 在生成海报之前，我们需要优先生成二维码

假设当前需要生成的二维码值为`https://www.mrye.xin`网址，我们在控制器中添加如下代码：

```
$qrcode = new icarexm\poster\Qrcode(ROOT_PATH);
$qrcode = $qrcode->create('https://www.mrye.xin');
//绝对路径
echo $qrcode->getPathname();
//相对路径
echo $qrcode->getSrcname();

```

生成如下二维码：

[![](https://camo.githubusercontent.com/483b4c86c093d20335189466b94fad0e798dabf8281e019c377b322362605900/68747470733a2f2f6769742e6b616e636c6f75642e636e2f7265706f732f79686c31382f77715f6672616d652f7261772f633962663364363431376338303736663036366335376364313561633536353634383333636164312f696d616765732f33663237613238626264303661376237383263323630363131346332303031622e706e673f6163636573732d746f6b656e3d65794a30655841694f694a4b563151694c434a68624763694f694a49557a49314e694a392e65794a6c654841694f6a45314f5441314e4445794f444d73496d6c68644349364d5455354d4451354f4441344d797769636d567762334e706447397965534936496e6c6f62444534584339336356396d636d46745a534973496e567a5a5849694f6e736964584e6c636d3568625755694f694a35614777784f434973496d3568625755694f694a4e636c6c6c4e5467324f534973496d567459576c73496a6f694e5455314f4455784f544241635845755932397449697769644739725a5734694f6949334d5455784e3252694d7a63344d4751794d6a41324d6a63314f546c6c4d6a4d305a5452684f4759354e694973496d463164476876636d6c365a53493665794a7764577873496a7030636e566c4c434a7764584e6f496a7030636e566c4c434a685a4731706269493664484a315a58313966512e5272743941715872626d626548742d45764c73522d313155306c77794867426f46464e3565686b4b706155)](https://camo.githubusercontent.com/483b4c86c093d20335189466b94fad0e798dabf8281e019c377b322362605900/68747470733a2f2f6769742e6b616e636c6f75642e636e2f7265706f732f79686c31382f77715f6672616d652f7261772f633962663364363431376338303736663036366335376364313561633536353634383333636164312f696d616765732f33663237613238626264303661376237383263323630363131346332303031622e706e673f6163636573732d746f6b656e3d65794a30655841694f694a4b563151694c434a68624763694f694a49557a49314e694a392e65794a6c654841694f6a45314f5441314e4445794f444d73496d6c68644349364d5455354d4451354f4441344d797769636d567762334e706447397965534936496e6c6f62444534584339336356396d636d46745a534973496e567a5a5849694f6e736964584e6c636d3568625755694f694a35614777784f434973496d3568625755694f694a4e636c6c6c4e5467324f534973496d567459576c73496a6f694e5455314f4455784f544241635845755932397449697769644739725a5734694f6949334d5455784e3252694d7a63344d4751794d6a41324d6a63314f546c6c4d6a4d305a5452684f4759354e694973496d463164476876636d6c365a53493665794a7764577873496a7030636e566c4c434a7764584e6f496a7030636e566c4c434a685a4731706269493664484a315a58313966512e5272743941715872626d626548742d45764c73522d313155306c77794867426f46464e3565686b4b706155)

生成海报
----

[](#生成海报)

下面来看下海报操作类的基础方法。

控制器中添加如下的代码：

```

$qrcode = new icarexm\poster\Qrcode(ROOT_PATH);
$qrcodePath = $qrcode->create('https://www.mrye.xin')->getPathname();
$config = array(
            'image' => array(
                //二维码资源
                array(
                    //资源路径
                    'url'       => $qrcodePath,
                    //相当于x
                    'left'      => 904,
                    //相当于y
                    'top'       => 1816,
                    'right'     => 0,
                    'bottom'    => 0,
                    //宽度
                    'width'     => 279,
                    //高度
                    'height'    => 275,
                    //删除临时文件
                    'isUnlink'  => true,
                ),
                //用户头像
                array(
                    'url'       => 'mryelogo.jpg',
                    'left'      => 554,
                    'top'       => 1078,
                    'right'     => 0,
                    'bottom'    => 0,
                    'width'     => 197.25,
                    'height'    => 194.25,
                    'isUnlink'  => true,
                ),
            ),
            //用户昵称
            'text' => array(
                array(
                    'text'      => 'MrYe',
                    'left'      => 551,
                    'top'       => 336,
                    //字号
                    'fontSize'  => 38,
                    //字体颜色
                    'fontColor' => '#000000',
                )
            ),
        );

        try {

            //生成海报
            $poster = new icarexm\poster\Poster(ROOT_PATH);
            $poster->createPoster('haibao.jpg', $config);
            //绝对路径
            echo $poster->getPathname();
            //相对路径
            echo $poster->getSrcname();

        } catch (\Exception $exception) {

            exit('error:'.$exception->getMessage());
        }

```

生成后的海报效果如下： [![](https://camo.githubusercontent.com/47297c0b3addb29fa3af6e5111c53f7620bd1fc86b80ebf027eaa5fb2ad32c0c/68747470733a2f2f6769742e6b616e636c6f75642e636e2f7265706f732f79686c31382f77715f6672616d652f7261772f633962663364363431376338303736663036366335376364313561633536353634383333636164312f696d616765732f68622e6a70673f6163636573732d746f6b656e3d65794a30655841694f694a4b563151694c434a68624763694f694a49557a49314e694a392e65794a6c654841694f6a45314f5441314e4445794f444d73496d6c68644349364d5455354d4451354f4441344d797769636d567762334e706447397965534936496e6c6f62444534584339336356396d636d46745a534973496e567a5a5849694f6e736964584e6c636d3568625755694f694a35614777784f434973496d3568625755694f694a4e636c6c6c4e5467324f534973496d567459576c73496a6f694e5455314f4455784f544241635845755932397449697769644739725a5734694f6949334d5455784e3252694d7a63344d4751794d6a41324d6a63314f546c6c4d6a4d305a5452684f4759354e694973496d463164476876636d6c365a53493665794a7764577873496a7030636e566c4c434a7764584e6f496a7030636e566c4c434a685a4731706269493664484a315a58313966512e5272743941715872626d626548742d45764c73522d313155306c77794867426f46464e3565686b4b706155)](https://camo.githubusercontent.com/47297c0b3addb29fa3af6e5111c53f7620bd1fc86b80ebf027eaa5fb2ad32c0c/68747470733a2f2f6769742e6b616e636c6f75642e636e2f7265706f732f79686c31382f77715f6672616d652f7261772f633962663364363431376338303736663036366335376364313561633536353634383333636164312f696d616765732f68622e6a70673f6163636573732d746f6b656e3d65794a30655841694f694a4b563151694c434a68624763694f694a49557a49314e694a392e65794a6c654841694f6a45314f5441314e4445794f444d73496d6c68644349364d5455354d4451354f4441344d797769636d567762334e706447397965534936496e6c6f62444534584339336356396d636d46745a534973496e567a5a5849694f6e736964584e6c636d3568625755694f694a35614777784f434973496d3568625755694f694a4e636c6c6c4e5467324f534973496d567459576c73496a6f694e5455314f4455784f544241635845755932397449697769644739725a5734694f6949334d5455784e3252694d7a63344d4751794d6a41324d6a63314f546c6c4d6a4d305a5452684f4759354e694973496d463164476876636d6c365a53493665794a7764577873496a7030636e566c4c434a7764584e6f496a7030636e566c4c434a685a4731706269493664484a315a58313966512e5272743941715872626d626548742d45764c73522d313155306c77794867426f46464e3565686b4b706155)

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![icarexm](https://avatars.githubusercontent.com/u/65947546?v=4)](https://github.com/icarexm "icarexm (1 commits)")

### Embed Badge

![Health badge](/badges/icarexm-poster/health.svg)

```
[![Health](https://phpackages.com/badges/icarexm-poster/health.svg)](https://phpackages.com/packages/icarexm-poster)
```

###  Alternatives

[phpviet/number-to-words

Thư viện hổ trợ chuyển đổi số sang chữ số.

219.9k5](/packages/phpviet-number-to-words)

PHPackages © 2026

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