PHPackages                             eliepse/working-grid-pdf - 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. eliepse/working-grid-pdf

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

eliepse/working-grid-pdf
========================

Library to easily create working grids and export them as PDF

2.5.0(5y ago)0119[1 PRs](https://github.com/Eliepse/working-grid-pdf/pulls)MITPHPPHP ^8.0CI passing

Since Sep 30Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/Eliepse/working-grid-pdf)[ Packagist](https://packagist.org/packages/eliepse/working-grid-pdf)[ RSS](/packages/eliepse-working-grid-pdf/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (1)Versions (29)Used By (0)

Working grid PDF
================

[](#working-grid-pdf)

Library to easily create working grids and export them as PDF

This library works with SVG. If you are looking for resources about chinese characters, strokes as svg, you might want to take a look at [Make Me A Hanzi](https://github.com/skishore/makemeahanzi).

Installation
------------

[](#installation)

You can install this library using composer.

```
$ composer require eliepse/working-grid-pdf

```

Usage
-----

[](#usage)

The most basic way of using this library would be like the following. You can see a more complete exemple in the [public](/public) directory.

```
use Eliepse\WorkingGrid\Character;
use Eliepse\WorkingGrid\Elements\Word;
use Eliepse\WorkingGrid\Template\Examples\DefaultTemplate;
use Eliepse\WorkingGrid\WorkingGrid;

// Use the static method to generate pdf
// passing a template and an array of words
WorkingGrid::inlinePrint(
    new DefaultTemplate,
    [
        new Word([new Character("中", [strokes data here])]),
        new Word([new Character("国", [...])]),
        new Word([
            new Character("中", [...]),
            new Character("国", [...])
        ])
    ]
);
```

### Words, characters and strokes data

[](#words-characters-and-strokes-data)

#### Words

[](#words)

This libray support multi-characters words. To normalize data, pass, you must instanciate your `Word` class with `Drawable` elements. The `Character` class is a ready-to-use *Drawable.*

#### Characters

[](#characters)

`Character` class takes two parameters: the character as a string and the strokes of this character. To draw the character, this library uses SVG data. Pass strokes data as an array. If you want to show a help to draw the characters in the right order, order the array as well. Using this class is not required, you can create your own but it must implement the `Drawable` interface.

An exemple of an array of strokes for the character 四:

```
[
    "M 326 667 Q 283 663 312 640 [...] Q 420 673 326 667 Z",
    "M 329 421 Q 304 417 332 392 [...] Q 435 441 329 421 Z",
    "M 130 165 Q 102 162 122 139 [...] Q 643 210 130 165 Z"
]
```

To see more exemples data, check the content of the [/samples/strokes](/resources/samples/strokes) folder where some characters are stored in JSON. Take a look at [Make Me A Hanzi](https://github.com/skishore/makemeahanzi) to get more open source strokes data !

### Templates

[](#templates)

In order to provide flexibility and customization, this library use a system of templates. To make a custom working grid, create a class that extends `Template`, or use [predifiened examples](/src/Template/Examples).

```
class MyTemplate extends Template
{
    // You can override parameters here,
    // see configuration chapter of this file
}
```

### Custom header and footer

[](#custom-header-and-footer)

When creating a template, you can implements `CustomizableHeader` and `CustomizableFooter` in order to customize the header and footer. The methods include a access to the instance of [mPDF](https://github.com/mpdf/mpdf) used to render the document, and an `PageInfo` object with information of the current drawn page.

### Extras

[](#extras)

#### Strokes order

[](#strokes-order)

Too print a help that show the strokes order, simply implement the `WithDrawingTutorial` interface to your template.

#### Pinyin

[](#pinyin)

If you want to show the pinyin of caracters, implement the `WithPinyin` interface to your template.

### Configuration

[](#configuration)

You can use differents properties to customize your document. All are accessible in the template and some are accessible as template constructor's parameters.

PropertyTypeDescriptiontitlestringThe title of the document.columns\_amountintegerThe number of cells (columns) per line, influence the size of cells.model\_amountintegerThe number of cells that keep a light gray character as a helping model.paddingsarraySet the padding of pages in millimeters. Formated as CSS : top, right, bottom, left.header\_heightfloatSet the header height in millimeters.footer\_heightfloatSet the footer height in millimeters.stroke\_colorfloatSet the color of the first drawn character.model\_colorstringSet the color the characters dranw as models.grid\_colorstringSet the color of the grid.guide\_colorstringSet the color of guide strokes (background).#### Features

[](#features)

PropertyTypeDescriptiontutorial\_heightfloatThe size, in millimeters, of box that shows a help for drawing strokes. Relative to the cell size when set to 0.Built With
----------

[](#built-with)

- [mPDF](https://github.com/mpdf/mpdf): PHP library generating PDF files from UTF-8 encoded HTML
- [Make Me A Hanzi](https://github.com/skishore/makemeahanzi): Free, open-source Chinese character data
- [Source Han Sans](https://github.com/adobe-fonts/source-han-sans): a typeface from Adobe
- [Ideohint Template for Source Han Sans](https://github.com/be5invis/source-han-sans-ttf): A (hinted!) version of Source Han Sans

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity78

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

Every ~36 days

Recently: every ~66 days

Total

26

Last Release

1920d ago

Major Versions

0.3.3 → 1.0.02018-10-03

1.1.0 → 2.0.0-beta2018-10-15

PHP version history (2 changes)0.1.0PHP &gt;=7.1

2.4.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3075627?v=4)[Elie Meignan](/maintainers/Eliepse)[@Eliepse](https://github.com/Eliepse)

---

Top Contributors

[![Eliepse](https://avatars.githubusercontent.com/u/3075627?v=4)](https://github.com/Eliepse "Eliepse (115 commits)")

---

Tags

chinesechinese-charactersdrawpdfpdf-generationphptrainingworking-gridpdfChineseworking grid

### Embed Badge

![Health badge](/badges/eliepse-working-grid-pdf/health.svg)

```
[![Health](https://phpackages.com/badges/eliepse-working-grid-pdf/health.svg)](https://phpackages.com/packages/eliepse-working-grid-pdf)
```

###  Alternatives

[carlos-meneses/laravel-mpdf

Laravel Mpdf: Using Mpdf in Laravel to generate Pdfs.

4423.3M10](/packages/carlos-meneses-laravel-mpdf)[kartik-v/yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.

1605.6M86](/packages/kartik-v-yii2-mpdf)[contributte/pdf

Pdf response extension for Nette Framework

43998.4k3](/packages/contributte-pdf)[borales/yii-pdf

Yii-wrapper for PHP-PDF libraries (mPDF, HTML2PDF)

59109.1k](/packages/borales-yii-pdf)[robregonm/yii2-pdf

Yii 2 PDF Response Formatter

4647.8k1](/packages/robregonm-yii2-pdf)[hi-folks/ibis-next

Creating EPUB and PDF ebook from Markdown

1181.1k](/packages/hi-folks-ibis-next)

PHPackages © 2026

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