PHP code example of eliepse / working-grid-pdf

1. Go to this page and download the library: Download eliepse/working-grid-pdf library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

eliepse / working-grid-pdf example snippets


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("国", [...])
        ])
    ]
);

[
    "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"
]

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